Software Archive
Read-only legacy content
17061 Discussions

Can't build iOS App for production

MM_H_
Beginner
997 Views

Before updaing to 3088, when you built an iOS app, you had the opportunity to select which provisioning profile you wanted in the build tab, and I would always have to switch that to either production or adhoc as necessary. Note this selection was in the BUILD tab - not the build settings field on the PROJECTS tab. Now this option is gone, and the last one I selected - adhoc - is the only one that will work. I have an iOS app in the store and have been using the same adhoc and mobile provisioning profiles for months, but now my production builds all fail with the following logged message:

Error code 65 for command: xcodebuild with args: -xcconfig,.../myQC_v1_0/platforms/ios/cordova/build-release.xcconfig,-project,My Quickcharge.xcodeproj,ARCHS=armv7 arm64,-target,My Quickcharge,-configuration,Release,-sdk,iphoneos,build,VALID_ARCHS=armv7 arm64,CONFIGURATION_BUILD_DIR=.../myQC_v1_0/platforms/ios/build/device,SHARED_PRECOMPS_DIR=.../myQC_v1_0/platforms/ios/build/sharedpch
Command finished with error code 2: .../myQC_v1_0/platforms/ios/cordova/build --release,--device
ERROR building one of the platforms: Error: .../myQC_v1_0/platforms/ios/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: .../myQC_v1_0/platforms/ios/cordova/build: Command failed with exit code 2
    at ChildProcess.whenDone (.../cordova/cordova-cli/5.1.1/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)

 

 

0 Kudos
1 Solution
Swati_S_Intel1
Employee
997 Views

That error is because you did not use the same certificate that you created with the .csr file generated by XDK in the same session. First, if you already have 3 certificate on Apple Developer portal, remove one of them that you are not using. You can only create up to 3 certificates. Then follow the video to generate P12 in one shot (you have to be in the same XDK session through the process. i.e.

1) create .csr from Intel XDK (do not close the dialog box to upload .cer file)

2) click on the link Apple Developer Portal from the dialog box (do not close the dialog box in XDK)

3) upload .csr on Apple Developer Portal

4) Generate certificate on Apple developer portal

5) download .cer file from the Developer portal

6) Come back to XDK dialog box where you left off from step 1, press Next. Select .cer file that you got from step 5.

View solution in original post

0 Kudos
15 Replies
Amrita_C_Intel
Employee
997 Views

You may need to uninstall the existing app on your device and then try building it again.

0 Kudos
MM_H_
Beginner
997 Views

I uninstalled Intel XDK and re-tried. The same error occurs as above.

0 Kudos
Amrita_C_Intel
Employee
997 Views

I meant the mobile app which you might have downloaded.

0 Kudos
MM_H_
Beginner
997 Views

What does the app being installed on some device or not have to do with being able to build an IPA file through intel XDK...

0 Kudos
Swati_S_Intel1
Employee
997 Views

@MM, Yes, the provisioning profile file selection has now moved to the Projects tab. If you chose adhoc in the provisioning profile box, you provide the adhoc provisioning profile in the next box that says Adhoc Provisioning Profile, and provide Production Provisioning profile if you chose Production. I guess that part is clear. Now, for Apple App Store, you have to use production provisioning profile when you push to the store, I don't understand how you were able to push to the App Store with Adhoc provisioning profile. But in any case the reason you are not able to build now is most likely the mismatch of provisioning profile and possibly certificate or App ID. Irrespective of wether you are using Adhoc or Production profile, make sure you have associated the certificate that you are using to build with the provisioning profile you are using to build. Also, make sure while generating provisioning profile you have used the same AppID as you are using in the build settings. If all of those things are correct, please let me know which plugins are you using? There might be a plugin conflict that fails the build. But most likely my suspicion is the provisioning profile is not correct. Please check the above and get back to me.

0 Kudos
MM_H_
Beginner
997 Views

Like I said before - I have been using these same provisioning profiles since last year and have successfully made multiple adhoc and production builds with them - they are not the issue. I re-downloaded our production provisioning profile from apple and tried again with the same results.

I am well aware of the provisioning profile selection on the projects tab, as I mentioned previously, and both provisioning profiles are set properly there. The selector is set on production - like I said it only fails when I try to make a production build, when I switch to adhoc it works fine and builds an adhoc build. I was not uploading an adhoc build to the apple store, as that is impossible. For whatever reason Intel XDK is failing my validate my valid production provisioning profile.

I checked the XML files after a build attempt with production selected and everything is properly set to production:

<preference name="ios-configuration" value="production"/>

<intelxdk:provisioning intelxdk:src="My_App.mobileprovision" intelxdk:type="production"/>

 

I have been using the same plugins with no changes for a few months; the plugins I am using are: Device, Network Information, Splashscreen, StatusBar, and Certificates. All of these have been successfully built into adhoc and production builds previously, including in the current version of our App on the Apple App Store.

 

 

0 Kudos
Swati_S_Intel1
Employee
997 Views

Can you PM your project zip to me? I haven't been able to reproduce this. I will try with your project to narrow down the issue.

0 Kudos
PaulF_IntelCorp
Employee
997 Views

MM -- are you using any Unicode characters in the passwords that you use with the iOS certs? We have been having some difficulties with non-ASCII characters in passwords (ie., passwords that contain only 7-bit ASCII chars are good, others have problems) and alias names getting corrupted. Try uploading your Apple cert again, and assign a simple password and alias name that only use 7-bit ASCII characters.

0 Kudos
MM_H_
Beginner
997 Views

Swati - sent the project to you.

 

Paul - thanks for the suggestion, but our passwords already only contain 7-bit ASCII chars.

0 Kudos
Swati_S_Intel1
Employee
997 Views

@MM, I tested your app with my certificate and provisioning profile and it builds fine. The plugins are fine, I checked you provisioning file also and it looks okay. Only thing I suspect is that the certificate you are using may not be associated with the provisioning profile. Try generating a new provisioning profile with the certificate you are using. Also, I hope you have created a P12 file using the same certificate under Account Settings. Also, are you on Windows or Mac? Try clearing the Intel XDK cache from the install location of XDK. On Mac: ~/Library/Application Support/XDK/Cache, on Windows %LocalAppData%\XDK\Cache

After all that if it does not work, send me the full build log and also xdk.log file from your XDK install location.

0 Kudos
MM_H_
Beginner
997 Views

I generated a new cert, p12 file and provisioning file and still received the same error. I also made a p12 file on our Mac and imported it, but the error is still there. I am attempting to build this app on Windows. The cache shouldn't be an issue, as I had already reinstalled XDK once to try to fix this, but I tried again anyway to no effect. I am sending you the build log and xdk.log files.

0 Kudos
Swati_S_Intel1
Employee
997 Views

@MM, I looked at your build log. The issue is with your certificate. Please see this webinar video on how to create a P12 and provisioning profile. https://software.intel.com/en-us/videos/app-certificate-management, the P12 creation part comes at 16:45 min. Please follow the process for creating a P12 and generating Provisioning profile as shown in the video. 

0 Kudos
MM_H_
Beginner
997 Views

I followed the video as you suggested, but I am receiving an error on creating a new p12 file. When I go to set a password and save the new P12 file, I get an error saying "Certificate/Private key mismatch". Any ideas? I am able to create a p12 on my mac and import it successfully, but that didn't work in the actual build.

0 Kudos
Swati_S_Intel1
Employee
998 Views

That error is because you did not use the same certificate that you created with the .csr file generated by XDK in the same session. First, if you already have 3 certificate on Apple Developer portal, remove one of them that you are not using. You can only create up to 3 certificates. Then follow the video to generate P12 in one shot (you have to be in the same XDK session through the process. i.e.

1) create .csr from Intel XDK (do not close the dialog box to upload .cer file)

2) click on the link Apple Developer Portal from the dialog box (do not close the dialog box in XDK)

3) upload .csr on Apple Developer Portal

4) Generate certificate on Apple developer portal

5) download .cer file from the Developer portal

6) Come back to XDK dialog box where you left off from step 1, press Next. Select .cer file that you got from step 5.

0 Kudos
MM_H_
Beginner
997 Views

Thanks for all of your help, finally got it to build properly. We believe there may have been an issue with Apple taking a while to revoke our cert, which complicated things, but today it worked without error. Thanks again for your help.

 

 

0 Kudos
Reply