Java 在eclipse中导出Android项目
我想导出我的Android项目,以便在Google Play上发布。出口成功 请看以下代码行:Java 在eclipse中导出Android项目,java,android,google-play,Java,Android,Google Play,我想导出我的Android项目,以便在Google Play上发布。出口成功 请看以下代码行: GsonSyncPathResolverModel gsonSyncPathResolverModel = new GsonSyncPathResolverModel(new GsonBuilder()); String TAG = "SyncPathReslover"; HttpResponse licenceManagementResponse =
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文件有什么问题吗
当我在Eclipse中签署.apk文件打开项目属性时,gson.jar库似乎不起作用。选择Java构建路径,单击订单和导出选项卡。确保选中gson.jar进行导出。在Eclipse中打开项目属性。选择Java构建路径,单击订单和导出选项卡。确保选中gson.jar进行导出。导出.apk文件后json.jar文件无法正常工作的原因与启用有关。因此,如果我禁用它或正确配置它,.jar文件也会正常工作。导出.apk文件后json.jar文件无法正常工作的原因与启用有关。因此,如果我禁用或正确配置它,.jar文件也会正常工作。首先:您不能安装未签名的apk,您的意思是您安装了使用调试密钥自动签名的apk。第二:您之前的json解析是否有错误?当您从eclipse运行时,您是在模拟器上还是在实际手机上运行它?您是从它的源代码中使用Gson还是作为.jar使用?如果您还没有这样做,我绝对建议您将其作为.jar文件使用(并确保它包含在您的构建路径中)。@WarrenFaith,不,我从eclipse运行它时没有收到任何错误,或者正如您使用调试密钥所说的那样。@nicopico,我在真实设备上运行它,然后查看控制台中的日志。首先:您不能安装未签名的apk,您的意思是您安装了使用调试密钥自动签名的apk。第二:您之前的json解析是否有错误?当您从eclipse运行时,您是在模拟器上还是在实际手机上运行它?您是从它的源代码中使用Gson还是作为.jar使用?如果您还没有这样做,我绝对建议您将其作为.jar文件使用(并确保它包含在您的构建路径中)。@WarrenFaith,不,当我从eclipse运行它时,或者正如您使用调试密钥所说的那样,我没有收到任何错误。@nicopico,我在真实的设备上运行它,并查看控制台中的日志。