codenameone / CodenameOne

Cross-platform framework for building truly native mobile apps with Java or Kotlin. Write Once Run Anywhere support for iOS, Android, Desktop & Web.
https://www.codenameone.com/
Other
1.7k stars 406 forks source link

iOS Certificate Wizard doesn't generate correctly provisioning profile with push enabled #3155

Open jsfan3 opened 4 years ago

jsfan3 commented 4 years ago

Steps to reproduce:

  1. Create a new bare bone project.
  2. Start the iOS Certificate Wizard.
  3. During the wizard, select:
    • use existing development and appstore certificates;
    • enable push;
    • would you like to generate new push certificates? Yes.
  4. Send an iOS debug build.

On the dashboard, you will see an error of building. The full log is short, it is:

Executing: /usr/local/bin/pod --version Process return code is 0
Pods version: 1.7.0.beta.3

User-level: 11000
Request Args: 
-----------------
ios.includePush=true
java.version=8
ios.buildType=debug
ios.newStorageLocation=true
-------------------
OS Version: 10.15.3
Executing: /Applications/Xcode11.3.app/Contents/Developer/usr/bin/xcodebuild -version Process return code is 0
Result is Xcode 11.3.1
Build version 11C505

Xcode version line matching pattern: Xcode 11.3.1
Executing: /Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/bin/java -Dretrolambda.inputDir=/var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/T/build2523735993398175845xxx/classes -Dretrolambda.classpath=/var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/T/build2523735993398175845xxx/classes:/var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/T/temp858045223392416453.jar -Dretrolambda.outputDir=/var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/T/build2523735993398175845xxx/classes_retrolamda -Dretrolambda.bytecodeVersion=49 -Dretrolambda.defaultMethods=true -jar /var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/T/temp3150744500873696516.jar Retrolambda 2.5.1
00:00  INFO: Bytecode version: 49 (Java 5)
00:00  INFO: Default methods:  true
00:00  INFO: Input directory:  /var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/T/build2523735993398175845xxx/classes
00:00  INFO: Output directory: /var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/T/build2523735993398175845xxx/classes_retrolamda
00:00  INFO: Classpath:        [/var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/T/build2523735993398175845xxx/classes, /var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/T/temp858045223392416453.jar]
00:00  INFO: Included files:   all
00:00  INFO: Agent enabled:    false
00:00  INFO: Saving lambda class: net/informaticalibera/test/appletest/MyApplication$$Lambda$2
Process return code is 0
Executing: javac -classpath /var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/T/build2523735993398175845xxx/classes -d /var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/T/build2523735993398175845xxx/classes /var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/T/build2523735993398175845xxx/stub/MyApplicationStub.java Note: /var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/T/build2523735993398175845xxx/stub/MyApplicationStub.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Process return code is 0
Executing: javac -classpath /var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/T/build2523735993398175845xxx/classes -d /var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/T/build2523735993398175845xxx/seVer /var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/T/build2523735993398175845xxx/stub/MyApplicationStub.java Note: /var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/T/build2523735993398175845xxx/stub/MyApplicationStub.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Process return code is 0
Executing: security default-keychain -s login.keychain Process return code is 0
Provisioning profile does not have push enabled.  Either set the ios.includePush build hint to false or generate a new provisioning profile with push enabled

The generated "codenameone_settings.properties" is:

codename1.android.keystore=
codename1.android.keystoreAlias=
codename1.android.keystorePassword=
codename1.arg.ios.includePush=true
codename1.arg.ios.newStorageLocation=true
codename1.arg.java.version=8
codename1.displayName=AppleTest
codename1.icon=icon.png
codename1.ios.appid=92PT7LUSF8.net.informaticalibera.test.appletest
codename1.ios.certificate=
codename1.ios.certificatePassword=
codename1.ios.debug.certificate=/home/francesco/NetBeansProjects/AppleTest/iosCerts/development_certificate.p12
codename1.ios.debug.certificatePassword=password
codename1.ios.debug.provision=/home/francesco/NetBeansProjects/AppleTest/iosCerts/development_provisioning_profile.mobileprovision
codename1.ios.provision=
codename1.ios.release.certificate=/home/francesco/NetBeansProjects/AppleTest/iosCerts/appstore_certificate.p12
codename1.ios.release.certificatePassword=password
codename1.ios.release.provision=/home/francesco/NetBeansProjects/AppleTest/iosCerts/production_provisioning_profile.mobileprovision
codename1.j2me.nativeTheme=nbproject/nativej2me.res
codename1.languageLevel=5
codename1.mainName=MyApplication
codename1.packageName=net.informaticalibera.test.appletest
codename1.rim.certificatePassword=
codename1.rim.signtoolCsk=
codename1.rim.signtoolDb=
codename1.secondaryTitle=CodenameOne_Template
codename1.vendor=CodenameOne
codename1.version=1.0
ios.development.push.password=FK7X4uKc
ios.development.push.url=https\://codename-one-push-certificates.s3.amazonaws.com/net.informaticalibera.test.appletest_DevelopmentPush241ce020-8507-4fb6-94b1-8bed9bcedcc8.p12
ios.production.push.password=FK7X4uKc
ios.production.push.url=https\://codename-one-push-certificates.s3.amazonaws.com/net.informaticalibera.test.appletest_ProductionPush1e3d194b-f7a0-419b-8e50-cfc364750fcb.p12
jsfan3 commented 4 years ago

After logging into https://developer.apple.com, I opened the Development Provisioning Profile and the Production Provisioning Profile: both were invalid. To fix the problem, I clicked on "Edit" and then on "Save" to automatically regenerate them into a valid state, then I downloaded them and replaced them with those created by the wizard. The result is that the build server is now able to produce the iOS build without errors.

Waiting for an appropriate solution, we can use this workaround immediately.