Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-58311

NotSerializableException when uploading apk with appcenter-plugin

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • appcenter-plugin
    • None
    • Jenkins ver. 2.164.3
      appcenter-plugin ver. 0.1.0 (installed without having rebooted Jenkins yet)
    • 0.1.1

      I've added the appcenter-plugin to my clients' Jenkins configuration and added a Pipeline stage to build and publish `MyApp` to the AppCenter:

              stage('Publish MyApp') {
                  agent {
                      label 'Java'
                  }
                  environment {
                      APPCENTER_API_TOKEN = credentials('appcenter-api-token')
                  }
                  steps {
                      checkout scm
                      preparePropertiesFile()
                      sh """
                          ./gradlew clean \
                          :tester.android:assembleRelease
                      """
      
                      appCenter apiToken: env.APPCENTER_API_TOKEN,
                              ownerName: 'Me',
                              appName: 'MyApp',
                              pathToApp: 'my_app/build/outputs/apk/release/my_app-release-unsigned.apk'
                  }
              }
      

      The app builds fine but I receive a `NotSerializableException` within the `UploadTask` of the appcenter-plugin:

      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // withCredentials
      [Pipeline] End of Pipeline
      java.io.NotSerializableException: retrofit2.Retrofit$1
      	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
      	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
      	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
      	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
      	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
      	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
      	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
      	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
      	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
      	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
      	at hudson.remoting.UserRequest._serialize(UserRequest.java:264)
      	at hudson.remoting.UserRequest.serialize(UserRequest.java:273)
      Caused: java.io.IOException: Unable to serialize io.jenkins.plugins.appcenter.task.UploadTask@452eeea
      	at hudson.remoting.UserRequest.serialize(UserRequest.java:275)
      	at hudson.remoting.UserRequest.<init>(UserRequest.java:101)
      	at hudson.remoting.Channel.call(Channel.java:955)
      	at hudson.FilePath.act(FilePath.java:1159)
      	at io.jenkins.plugins.appcenter.AppCenterRecorder.uploadToAppCenter(AppCenterRecorder.java:104)
      	at io.jenkins.plugins.appcenter.AppCenterRecorder.perform(AppCenterRecorder.java:92)
      	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
      	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
      	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Finished: FAILURE
      

            mezpahlan Mez Pahlan
            sirrah Peter Oost
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: