我想导出我的 Android 项目以便在 Google Play 上发布。成功导出了。
看看这些代码行:
GsonSyncPathResolverModel gsonSyncPathResolverModel = new GsonSyncPathResolverModel(new GsonBuilder());
String TAG = "SyncPathReslover";
HttpResponse licenceManagementResponse = Client.get(REST_URL.GETSynchURLResolver(customerID));
int responseCode = licenceManagementResponse.getStatusLine().getStatusCode();
String responseString = EntityUtils.toString(licenceManagementResponse.getEntity());
Log.e(TAG, "response " + responseString);
System.out.println(responseString);
responseString=responseString.replace("{\"GetOrganizationInformationByOrganizationNumberResult\":\"[{","{");
responseString=responseString.replace("}]\"}","}");
responseString=responseString.replace('\\', Character.MIN_VALUE);
responseString=responseString.replaceAll(""+Character.MIN_VALUE,"");
System.out.println("#zzz "+responseString);
if (responseCode == 200) {
// syncPathResolver
licenceManagementResponse.getEntity().consumeContent();
SyncPathResolverModel syncPathResolverModel = gsonSyncPathResolverModel.parseJSON(responseString);
Log.e(TAG, "Response from Server: Organization ID:" + syncPathResolverModel.getObjectEntry_ID());
Log.e(TAG, "Response from Server: Sync Path:" + syncPathResolverModel.getSyncServiceURL());
当我直接从 Eclipse 运行项目时,最后一行代码工作正常,并打印出正确的值。
但是当我使用导出的 .apk 文件时,
Log.e(TAG, "Response from Server: Organization ID:" + syncPathResolverModel.getObjectEntry_ID());
Log.e(TAG, "Response from Server: Sync Path:" + syncPathResolverModel.getSyncServiceURL());
这两行打印出来null
。
你能帮我导出 .apk 文件有什么问题吗?
当我签署 .apk 文件时,gson.jar 库似乎不起作用