使用产品:supermap-imobile-11.1.1-android-chs-
操作系统:android
数据类型: 文件型
问题详细描述:代码申请使用许可 失败
问题重现步骤:
1. 代码调用登录:
cloudLicenseManager.login(username, password);
2. 在 LicenseLoginCallback 的 loginAccount() 回调里调用
cloudLicenseManager.applyTrial();
然后就在 LicenseLoginCallback 的 otherError() 里收到错误
License Error Code 1416
try {
Log.i("SuperMapManager", task+" loginSuperMap: LicensePath="+directory.getAbsolutePath());
com.supermap.data.Environment.setLicensePath(directory.getAbsolutePath());
} catch (Exception e) {
e.printStackTrace();
LogUtils.log(SuperMapManager.class.getSimpleName(), "initSuperMap: 设置许可文件路径错误,需要去下载");
}
com.supermap.data.Environment.setWebCacheDirectory(webCacheDir.getAbsolutePath());
com.supermap.data.Environment.setTemporaryPath(tempDir.getAbsolutePath());
com.supermap.data.Environment.setLanguage(com.supermap.data.Environment.Language.CHINESE);
com.supermap.data.Environment.initialization(CommonUtils.context);
final CloudLicenseManager cloudLicenseManager = CloudLicenseManager.getInstance(CommonUtils.context);
Log.i("SuperMapManager", "initializationSuperMap: userName="+username+" ; password="+password +" ;task="+task);
cloudLicenseManager.setLoginCallback(new CloudLicenseManager.LicenseLoginCallback() {
@Override
public void loginAccount(boolean b) {
Log.i("SuperMapManager", task+ " loginAccount: "+b);
// mMainHandle.obtainMessage(WHAT_INITIALIZATION_SUCCESS).sendToTarget();
// cloudLicenseManager.queryLicense();
cloudLicenseManager.applyTrial();
}
@Override
public void logoutAccount(boolean b) {
Log.i("SuperMapManager", task+"logoutAccount: "+b);
}
@Override
public void queryLicense(QueryFormalLicenseResponse queryFormalLicenseResponse) {
Log.i("SuperMapManager", task+" queryLicense: "+(queryFormalLicenseResponse!=null?queryFormalLicenseResponse.formal:"null"));
if (null != queryFormalLicenseResponse){
LicenseInfo[] licenses = queryFormalLicenseResponse.licenses;
if (null != licenses && licenses.length>0){
for (LicenseInfo licenseInfo:licenses){
Log.i("SuperMapManager", task+" queryLicense: id="+licenseInfo.id+"; version="+licenseInfo.version+"; 剩余天数="+licenseInfo.remainDays);
}
}
}
}
@Override
public void activeLicense(String s) {
Log.i("SuperMapManager", task+" activeLicense: "+s);
}
@Override
public void activeTriaLicense() {
Log.i("SuperMapManager", "activeTriaLicense: "+task);
}
@Override
public void recycleLicense(int i) {
Log.i("SuperMapManager", task+" recycleLicense: "+i);
}
@Override
public void otherError(String s) {
Log.i("SuperMapManager", task+" otherError: "+s);
mMainHandle.obtainMessage(WHAT_INITIALIZATION_FAIL,CommonConstants.CODE.ERROR_OTHER, 0, s)
.sendToTarget();
}
});
cloudLicenseManager.login(username, password);
麻烦帮忙处理一下