Closed sis0k0 closed 7 years ago
We are experiencing the same issue. Now we need to use xcode to release. This means we need a manual step in our build process. This is very inconvenient for us.
@dtopuzov Any hints as to what is wrong?
Fixed in web pack plugin with this PR: https://github.com/NativeScript/nativescript-dev-webpack/pull/116
We will release new version later today or tomorrow.
Amazing!!!
Ups sorry, it looks I was wrong and my previous post was for another issue.
Yeah - I can see as I'm still getting the same error... But thanks for letting me know, a moment right there I thought my computer was just being weird :-)
This PR is supposed to address this issue: #2705 There is some more work to be done though.
Thanks for letting me know @PanayotCankov! Is there a temporary fix that I can apply to get it working, as I'm just about to submit to itunes connect?
Hi @patrickpereira,
As a workaround you can do the following:
First, prepare the project for iOS using tns prepare ios
.
Then, bundle the project with webpack with webpack --config=webpack.ios.js --progress
(note: if you don't have webpack
installed globally, you should add this to your package.json scripts or run webpack from node_modules/.bin/webpack
).
When the project is bundled and prepared in the platforms/ios
folder, you can open it and release it through xcode.
We'll add a way to perform the first two steps with ns-bundle
and then release the app through xcode later.
@patrickpereira https://github.com/NativeScript/nativescript-cli/pull/2705 is merged in master and available in nativescript@next
.
Can you please try:
npm un -g nativescript
npm cache clean
npm i -g nativescript@next
@sis0k0 I followed the instruction you gave in the previous comments now to upload it i have to juss use the project workspace thats it.?
@dlucidone,
Yes, you can publish it through xcode now. Also now you can use the following command to just prepare and bundle the project (without building/starting it):
npm run ns-bundle --ios/--android
@sis0k0 Earlier i tried
npm run build-ios-bundle -- --release --for-device --copy-to /Users/Dlucidone/Desktop/yourappname_1-0-2.ipa --teamId DL***** --provision 32b**525-8*5d-46*9-a*da-c49****3**7e
i got my release ipa ready but i'm having issues with uploading it through Application loader
Should I use `tns publish ios -- ipa
Hey @dlucidone @patrickpereira @spike1292
I've managed to start my app by setting CODE_SIGN_IDENTITY and PROVISIONING_PROFILE using the latest @next of the CLI. Could you try and see if it will work for you as well?
Thanks!
@pkoleva I dont want to update my CLI moreover the itunes is not taking my webpacked release ipa. I have to use the platform workspace folder for the release result in app is slow at start time. Can you tell me way i can fix my webpack release issue cause its annoying and the docs are outdated with the release. Each time new release come with new bugs and later need to update CLI.(Tired of trying everything)
I'm having a similar issues trying to publish to iTunes connect.
When either using the Application Loader or running tns publish ios --ipa /myapp/platforms/ios/build/device/myapp.ipa I get the following error:
ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle org.nativescript.naturesnotebookmobile [Payload/myapp.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal."
Here's my processes:
First off I did this to make sure I'm up to date
npm un -g nativescript
npm cache clean
npm i -g nativescript@next
my build.xcconfig looks like so
CODE_SIGN_IDENTITY = iPhone Distribution;
PROVISIONING_PROFILE = iPhone Distribution;
DEVELOPMENT_TEAM = **hiding this**;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
I can build the ipa file using:
tns build ios --release --for-device
towards the end of the log I do see so I'm thinking it's picking the right cert (it has type iOS Distribution):
Signing Identity: "iPhone Distribution: **hiding this** (**hiding this**)"
Provisioning Profile: "iPhone Distribution"
(**hiding this**)
When I look in Keychain Access, I can see what looks to be the matching certificate and it has a private key attached. I had downloaded this cert from https://developer.apple.com/account/ios/certificate/?teamId=**hiding** and stuck it under login in Keychain Access.
When I open the project inXcode and go to preferences I can see the team and cert listed with no complaints.
In Xcode I currently have "Automatically manage signing" unchecked and have manually selected the iPhone Distribution provisioning profile under both Signing (debug) and Signing (release).
Any ideas as to why I'm getting the error?
Hi, @jeffswitzer,
Could you try to set PROVISIONING_PROFILE to the profile id. Also have a look at the "Submission automation" part of this article -> http://docs.nativescript.org/publishing/publishing-ios-apps#submission-automation. Hope this helps :)
@pkoleva I am having the same issue (I think) as @jeffswitzer:
I am trying to upload a webpack release bundle the app store. I am able to successfully build the bundle through: npm run build-ios-bundle -- --release --for-device
.
My build.xcconfig contains (same as with Xcode signing settings):
//DEVELOPMENT_TEAM
CODE_SIGN_IDENTITY = iPhone Distribution
PROVISIONING_PROFILE_SPECIFIER = <TEAM ID>/<company name> Distribution
(from what I am reading is that with Xcode 8, PROVISIONING_PROFILE is deprecated)
The build process the informs me:
Signing Identity: "iPhone Distribution: <company name> (<TEAM ID>)"
Provisioning Profile: "Panaya Distribution"
(<distribution profile UUID>)
However, when uploading through application loader I get a similar error as above:
ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle com.panaya.testcenter [Payload/<appname>.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal."
When I inspect the IPA I can see that the /Payload/testapp.app/embedded.mobileprovision
indeed contains references to the development certificates and provisioning profiles instead of the distribution. I tried just now with today's nativescript@next
build.
If I use Xcode to create an archive and upload that one it works just fine (but then it won’t be webpacked).
Seems like there is some kind of bug here.
+1 - exactly same issue for me as well, running next builds.
BTW I just now noticed that after running npm run build-ios-bundle -- --release --for-device
the platforms/ios/build/device/panaya.app/embedded.mobileprovision
DOES contain what seems to be the right certificate/profile, just the IPA it creates does not.
Could you try to do an npm run build-ios-bundle -- --release --for-device
and then open the Xcode project (or workspace should you be using cocoapod dependencies) in platforms/ios and then "Archive" the project and from the archive "Export for App Store Distribution". This is the workflow used with native apps, it builds the app signed with development certificate and development provisioning profile, but the export then resigns the app replacing the development provisioning profile with distribution one.
This #2705 has not been officially released and is available in nativescript@next, once it is officially released, you should be able to use PROVISIONING_PROFILE_SPECIFIER in the xcconfig.
@PanayotCankov Thanks for replying. I am currently already using yesterday's nativescript@next
so I think it should already be using PROVISIONING_PROFILE_SPECIFIER (indeed I can see it displays to screen that it is signing using the Distribution Profile (but as I wrote above the IPA is signed with the Development, even though the unpacked platforms/ios/build/device/panaya.app
does seem to contain the correct embedded.mobileprovision
. Therefore, I think that also nativescript@next
still contains a bug (I have the May 29th version).
Indeed it seems the Xcode export is resigning. Is there a way to tell Xcode to take the IPA created by nativescript (the webpacked version)? I see only builds that I created through Product->Archive and don't see any way to tell Xcode to import an externally created IPA.
I tried manually signing the IPA created by nativescript as follows:
$ codesign --force -s "iPhone Distribution: <company name> (<TEAM ID>)" -v ./appname.ipa
./platforms/ios/build/device/appname.ipa: signed generic [<company name>]
However, it still does not allow me to upload the IPA through Application Loader. Not sure how it should work exactly, but I can see the archive still contains the development version of the embedded.mobileprovision
.
Thanks!
Hi @abhayastudios
We will look for potential issues in the CLI and update the issue once we have more info.
May be this can help as temporary workaround: https://github.com/fastlane/fastlane/tree/master/sigh#resign
@pkoleva Thank you - I took your advice and set PROVISIONING_PROFILE = iPhone Distribution: hiding_profile_name (hiding_uuid);
Then I ran tns build ios --release --for-device
everything looked good
Then I ran tns publish ios
everything looked good, the log ended with:
[2017-05-30 09:57:50 MST] <main> INFO: The session's final state is Complete
[2017-05-30 09:57:50 MST] <main> INFO: Number of files transferred: 2 . Names of files transferred:
[2017-05-30 09:57:50 MST] <main> INFO: /var/folders/j7/ccr72dlx47v9k3b3cqn6nbq00000gn/T/itms-117430-1797-nebk4m.4c0dn7y14i/mybundle.itmsp/app.ipa - Complete
[2017-05-30 09:57:50 MST] <main> INFO: /var/folders/j7/ccr72dlx47v9k3b3cqn6nbq00000gn/T/itms-117430-1797-nebk4m.4c0dn7y14i/mybundle.itmsp/metadata.xml - Complete
[2017-05-30 09:57:50 MST] <main> INFO: The package's files (mybundle.itmsp) uploaded successfully.
[2017-05-30 09:57:50 MST] <main> INFO: Done performing upload.
[2017-05-30 09:57:50 MST] <main> INFO: id = 20170530095750-854
[2017-05-30 09:57:51 MST] <main> INFO: Done performing uploadDone notification to Apple.
[2017-05-30 09:57:51 MST] <main> INFO: The package: /var/folders/j7/ccr72dlx47v9k3b3cqn6nbq00000gn/T/itms-117430-1797-nebk4m.4c0dn7y14i/mybundle.itmsp has been successfully uploaded.
Package Summary:
1 packages were uploaded successfully:
/var/folders/j7/ccr72dlx47v9k3b3cqn6nbq00000gn/T/itms-117430-1797-nebk4m.4c0dn7y14i/mybundle.itmsp
Then I logged onto iTunes connect and it said the build was processing under the activity tab. After a few minutes I logged out and logged back in to iTunes connect and the build no longer shows up as processing. Further more no builds are listed at all :S The build just disappeared. So at this point I'm guessing the cert and profile are ok, but something else is wrong with my build? Has anyone else ran into this?
@jeffswitzer as far as I can tell tns publish ios
runs a new non-webpacked build resulting in a 21mb IPA for my app (as opposed to 14mb with a webpack build), so I think that is what you uploaded to the app store.
From what I understand if you run npm run build-ios-bundle -- --release --for-device
and then archive through xcode, it will archive your webpacked build.
Actually even if I just target the built ipa like tns publish ios --ipa ~/myNativeScriptApp/platforms/ios/build/device/myApp.ipa
I still get
1 package(s) were not uploaded because they had problems:
/var/folders/j7/ccr72dlx47v9k3b3cqn6nbq00000gn/T/itms-117430-25793-1pi4a95.f84asv2t9/mybundle.itmsp - Error Messages:
ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle org.nativescript.myApp [Payload/myApp.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal."
So when I target the ipa built from tns build ios --release --for-device
I get the signing error, but if I just run tns publish ios
I don't get the error, but the build disappears from iTunes connect shortly after it is in the processing state. I guess my issues doesn't even require a webpacked build to fail.
@jeffswitzer I can confirm that by running npm run build-ios-bundle -- --release --for-device
and then archive and upload through Xcode, you can successfully publish to the app store (at least the build I just uploaded works in Test Flight) and results in a significantly smaller download that the non-webpack version.
@abhayastudios manually resigning is futile. There are a lot of extra details, first you will have to remove the development mobileprovision, add the distribution mobileprovision. Then code sign the app executable as well as binaries of cocoa touch frameworks you may have used in the Frameworks folder. Zip back the ipa.
tns publish ios won't work with web pack indeed, you have to use the npm scripts. After this commit:
https://github.com/NativeScript/nativescript-dev-webpack/commit/8e7a1b36ac1229b35fbb7ef120a921ffc6f66250
is released you should be able to use npm run publish-app
along with npm run-app
and npm build-app
.
For now use npm run build-ios-bundle -- --release --for-device
and then open the Xcode workspace or project, from the IDE archive, and from the archive you can sign for distribution and upload to the store.
@PanayotCankov if i'll use this command
npm run build-ios-bundle -- --release --for-device
then i'll get ipa for my app how can i use it to sign with xcode as opening the project in xcode will not use the webpacked generated ipa can you elaborate steps to perform webpacking app along with signing it.
@dlucidone After you run npm run build-ios-bundle -- --release --for-device
the Xcode project in the platforms/ios should have the web pack assets, you should be able to open that project in Xcode. From the device selection (near the play / stop buttons) select Generic iOS Device. Then in the top menu select Product > Archive. This will open the Organiser window and focus the archive, in the righthand section there you have the options to "Upload to App Store", "Validate..." and "Export...". Consider using the "Upload to App Store...", it will ask you for Team ID and will sign and upload the app to the App Store.
@PanayotCankov i have a doubt if i'll use this command
npm run build-ios-bundle -- --release --for-device
my ipa will be generated right? Correct me if i'm wrong .
And if I will open project again in xcode and again archive it will not use the ipa build already generated i think it will generate new one because i have seen huge performance lag in launch screen compared to webpacked ipa and generating ipa by archiving it through xcode.
If you can do steps below i suggest you can measure difference -
1- Create a webpacked release ipa and then test it through iTunes on device the performance is much better. 2- Webpack and use platform folder and then again archive it then use that ipa i find lot of performance difference in both the scenarios. Thanks
I have the same or a similar issue as @abhayastudios and @jeffswitzer
Signing with ad-hoc distribution profiles does not work properly. It seems that the ipa is signed with a developer identity. This blocks us from upgrading to NS3 and xcode 8.3. We have to stick with NS 2.5.3 and xcode 8.2 for now...
@dbenninger I followed instructions by @PanayotCankov and seems like i'm able to deliver my app to test flight with webpacking.
@dlucidone thanks, thats good to know, but it must also work on our ci server.
Okay, I have found a workaround. I had to add
`
@dbenninger Thanks for posting the workaround.
@dbenninger thank you! I was going absolutely mad. In my case I needed to use <key>method</key> <string>app-store</string>
This link has the available options.
Note that even when not using webpack it seems I need to have this in my Info.plist. The steps I take are:
Without <key>method</key> <string>app-store</string>
the publish step gives the ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle org.nativescript.myApp [Payload/myApp.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal."
@dbenninger THANK YOU! 🌮
@PanayotCankov @sis0k0 @pkoleva Why is it necessary to add <key>method</key><string>app-store</string>
to your Info.plist
to perform release builds that iTunes Connect accepts?
We either need to workaround this on the CLI, or we need to get this on the documentation asap. I can help with the docs, but I need to know what we want to recommend here, and why this works the way it does.
Could the CLI handle this for us when with the --release
flag maybe?
Because this is broken: https://github.com/NativeScript/nativescript-cli/blob/1955028ac3ded6a012813476f08d0f4f0d89dddd/lib/services/ios-project-service.ts#L262 We add the info.plist as plist for the export when building, while the export accepts completely different format. It is like a tool needs some data such as method = app-store in XML and we sticked the AndroidManifest.xml in it just in case.
I have tried to elaborate on the problem here: https://github.com/NativeScript/nativescript-cli/issues/3020
I have the same problem, even after trying to publish with 'ad-hoc' or 'app-store' suggestions from above..
@alereisan Did you manage to solve this issue? I tried 'ad-hoc- and 'app-store' like you but I still have it.
@cerireyhan I solved it by making a new provisioning profile and certificate.
From @patrickpereira on April 12, 2017 4:56
Hi Nativescript,
I keep getting errors trying to upload the .ipa to itunes connect, what are the build.xcconfig settings and the command that should be used, currently I'm having this in build.xcconfig:
CODE_SIGN_IDENTITY = iPhone Distribution
DEVELOPMENT_TEAM = XXXXXXXX OR PROVISIONING_PROFILE = XXXXXXXX
I've tried both DEVELOPMENT_TEAM & PROVISIONING_PROFILE
If I'm using DEVELOPMENT_TEAM I get the following error from application loader:
ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle app.nurt.kcal [Payload/Kcal.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal."
If I'm using PROVISIONING_PROFILE, I'm unable to build it and get the following error from the CLI:
Check dependencies Kcal has conflicting provisioning settings. Kcal is automatically signed, but provisioning profile XC iOS: app.nurt.kcal has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor, or switch to manual signing in the project editor. Code signing is required for product type 'Application' in SDK 'iOS 10.2' Code signing is required for product type 'Application' in SDK 'iOS 10.2' Code signing is required for product type 'Application' in SDK 'iOS 10.2' Code signing is required for product type 'Application' in SDK 'iOS 10.2'
I know the provisioning profile is valid, since I'm able to do the release through xcode if I compile the ipa there. But for some reason that ipa file is almost twice the size of the one created by the CLI.
The command I'm using in the CLI is: npm run build-ios-bundle -- --release --for-device
Furthermore I'm using tns-ios 2.5.
Hope you can help me ( @sis0k0 ) :-)
Copied from original issue: NativeScript/nativescript-dev-webpack#115