我正在尝试在EC2实例中使用Jenkins为Android应用程序设置持续交付。
在无任何消息的情况下,我在APK上传过程中出现了错误堆栈跟踪。
java.lang.NullPointerException
at org.jenkinsci.plugins.googleplayandroidpublisher.ApkUploadTask.execute(ApkUploadTask.java:82)
at org.jenkinsci.plugins.googleplayandroidpublisher.ApkUploadTask.execute(ApkUploadTask.java:33)
at org.jenkinsci.plugins.googleplayandroidpublisher.AbstractPublisherTask.call(AbstractPublisherTask.java:33)
at hudson.FilePath.act(FilePath.java:1161)
at org.jenkinsci.plugins.googleplayandroidpublisher.ApkPublisher.publishApk(ApkPublisher.java:375)
at org.jenkinsci.plugins.googleplayandroidpublisher.ApkPublisher.perform(ApkPublisher.java:195)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:79)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1843)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
我看了看源代码,发现插件无法从控制台读取现有apk的当前版本代码。我已授予尝试访问此api的服务帐户的所有访问权限。
// Get the list of existing APKs and their info
final List<Apk> existingApks = editService.apks().list(applicationId, editId).execute().getApks();
for (Apk apk : existingApks) {
existingVersionCodes.add(apk.getVersionCode());
}
所以我要获取现有的APK空值,有人遇到过同样的问题吗?