Skip to content

XCode 9: Requires Provisioning Profile Error #3132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dotnetdreamer opened this issue Sep 25, 2017 · 21 comments
Closed

XCode 9: Requires Provisioning Profile Error #3132

dotnetdreamer opened this issue Sep 25, 2017 · 21 comments
Assignees
Labels
Milestone

Comments

@dotnetdreamer
Copy link

Did you verify this is a real problem by searching Stack Overflow and the other open issues in this repo?

Yes

Tell us about the problem

I upgraded the tools on my machine to xcode 9. i have updated cli and build the project and it runs in simulator. Now when i wanna run in phone, i am getting the error:

tns run ios
error: exportArchive: "IAMobileApp.app" requires a provisioning profile.

I selected the provisioning profile in xcode (after openning the .xcodeproj file) and it was working in xcode 8.
screen shot 2017-09-25 at 12 32 32 pm

Which platform(s) does your issue occur on?

iOS

Please provide the following version numbers that your issue occurs with:

  • CLI: 3.2.0
  • Cross-platform modules: "nativescript": {
    "id": "org.nativescript.IA",
    "tns-android": {
    "version": "3.2.0"
    },
    "tns-ios": {
    "version": "3.2.0"
    }
    }

Please tell us how to recreate the issue in as much detail as possible.

build the project using tns build ios and then open the .xcodeproj file and select the provisioning profile and then type tns run ios

@briosheje
Copy link

I had a similar issue yesterday night and I was able to solve it by avoiding the provisioning profile and by, instead, adding a development team. You can probably do the same with the provisioning profile.

To solve the issue, go to App_Resources/iOS/build.xcconfig and either add a provisioning profile or a development team.

I think there is an official GitHub post about this in the nativescript section.

@dotnetdreamer
Copy link
Author

@briosheje i tried, but didn't suceed. it has todo with xcode 9 and ios11. It was working in xcode 8...

@mfradcourt
Copy link

@dotnetdreamer Were you able to find a solution to this problem? I'm facing exactly the same issue after an update of xcode to version 9.

@dotnetdreamer
Copy link
Author

dotnetdreamer commented Nov 9, 2017

@mfradcourt i didn't succeed. I had another mac machine with xcode 8, i am still using that...However i just tried (after upgrading nativescript and xocde) and it seems fine now in some cases...

@pap5508
Copy link

pap5508 commented Nov 14, 2017

@dotnetdreamer @mfradcourt : Are you able to find a solution to this problem ? I am facing the exactly same issue after updating to xcode version 9.

NativeScript/NativeScript#5059

@mfradcourt
Copy link

@pap5508 I chose the lazy solution and did reinstall xcode 8, you can download it from https://developer.apple.com/download/more/

@dotnetdreamer
Copy link
Author

@pap5508 no. For me debugging works but when i try to do build as release it doesn't. So i use xcode 8...

@jzgoda
Copy link
Contributor

jzgoda commented Nov 14, 2017

Thank you @dotnetdreamer & @mfradcourt!!!
I was going crazy assuming something had gone wrong with my certs...but once downgrading to Xcode 8, it worked PERFECTLY!

@dotnetdreamer
Copy link
Author

i just tested on xcode 9, it seems that tns run ios --provision "My Provisioning Profile" works.

@pap5508
Copy link

pap5508 commented Nov 16, 2017

@dotnetdreamer : I am getting following error while running
tns run ios --provision "My Provisioning Profile"

Xcode build...
2017-11-16 10:14:40.119 xcodebuild[2374:15698] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/7g/tp4sm6_n0dxcvs3zg3d7nwx80000gn/T/Hieber_2017-11-16_10-14-40.118.xcdistributionlogs'.
2017-11-16 10:16:22.099 xcodebuild[2374:15698] [MT] IDEDistribution: Step failed: <IDEDistributionPackagingStep: 0x7fbb6adfa8c0>: Error Domain=IDEFoundationErrorDomain Code=1 "ipatool failed with an exception: #<NoMethodError: undefined method `toolsPath' for nil:NilClass>
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:812:in `rawLoadCommands'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:828:in `rpaths'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:259:in `resolveLoadedDylibs'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1423:in `block (2 levels) in initialize'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1422:in `each'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1422:in `block in initialize'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1421:in `each'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1421:in `initialize'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2289:in `new'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2289:in `ProcessIPA'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2940:in `<main>'" UserInfo={NSLocalizedDescription=ipatool failed with an exception: #<NoMethodError: undefined method `toolsPath' for nil:NilClass>
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:812:in `rawLoadCommands'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:828:in `rpaths'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:259:in `resolveLoadedDylibs'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1423:in `block (2 levels) in initialize'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1422:in `each'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1422:in `block in initialize'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1421:in `each'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1421:in `initialize'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2289:in `new'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2289:in `ProcessIPA'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2940:in `<main>'}
error: exportArchive: ipatool failed with an exception: #<NoMethodError: undefined method `toolsPath' for nil:NilClass>
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:812:in `rawLoadCommands'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:828:in `rpaths'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:259:in `resolveLoadedDylibs'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1423:in `block (2 levels) in initialize'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1422:in `each'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1422:in `block in initialize'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1421:in `each'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1421:in `initialize'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2289:in `new'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2289:in `ProcessIPA'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2940:in `<main>'

Error Domain=IDEFoundationErrorDomain Code=1 "ipatool failed with an exception: #<NoMethodError: undefined method `toolsPath' for nil:NilClass>
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:812:in `rawLoadCommands'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:828:in `rpaths'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:259:in `resolveLoadedDylibs'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1423:in `block (2 levels) in initialize'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1422:in `each'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1422:in `block in initialize'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1421:in `each'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1421:in `initialize'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2289:in `new'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2289:in `ProcessIPA'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2940:in `<main>'" UserInfo={NSLocalizedDescription=ipatool failed with an exception: #<NoMethodError: undefined method `toolsPath' for nil:NilClass>
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:812:in `rawLoadCommands'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:828:in `rpaths'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:259:in `resolveLoadedDylibs'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1423:in `block (2 levels) in initialize'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1422:in `each'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1422:in `block in initialize'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1421:in `each'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1421:in `initialize'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2289:in `new'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2289:in `ProcessIPA'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2940:in `<main>'}

** EXPORT FAILED **

@ghost
Copy link

ghost commented Dec 1, 2017

Getting the same error as @pap5508 after
tns run ios --provision <prov id>

At the same time project can be successfully built with an XCode.

@romulowspp
Copy link

Same problem here, with xcode 9.2. My friend build with xcode 9.1, same project

@mudlabs
Copy link

mudlabs commented Dec 11, 2017

Just had this issue trying to get the NativeScript Hello World (spinning apple) project up and running on my device.

I fixed it by changing the id value in package.json. (for me was on line 7)

Change from "id": "org.nativescript.HelloWorld" to "id": "your.domain.HelloWorld"

@rosen-vladimirov
Copy link
Contributor

Hey @pap5508 ,
The error error: exportArchive: ipatool failed with an exception: #<NoMethodError: undefined method toolsPath' for nil:NilClass>` is caused by mismatch of Xcode and some xcodebuild tools. I've seen it on some El Capitan and Sierra machiens with latest Xcode (latest available for both machines). In my case the solution was to update to High Sierra and update to latest Xcode and Xcode build tools.
Can you give it a try?

@pap5508
Copy link

pap5508 commented Mar 7, 2018

@rosen-vladimirov : I have tried after updating all.. still getting the same error..

@hosikiti
Copy link

@pap5508 Getting the same `error: exportArchive: ipatool failed with an exception: #<NoMethodError: undefined methodtoolsPath' for nil:NilClass>`` as @pap5508 on High Sierra and XCode9.2.

As a temporary solution, I need to add "compileBitcode: false" to export options plist as this thread says: fastlane/fastlane#9642

For NativeScript,

  1. Find and open ios-project-service.js globally installed in your environment.
    If you are using nodebrew, it is found in the following path:
    ~/.nodebrew/current/lib/node_modules/nativescript/lib/services

  2. Find "exportDevelopmentArchive" method.

  3. Add following lines to the plistTemplate defined in the method.

<key>compileBitcode</key>
<false/>
  1. plistTemplate should be like this:
let plistTemplate = `<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>method</key>
	<string>${exportOptionsMethod}</string>`;
            if (options && options.provision) {
                plistTemplate += `    <key>provisioningProfiles</key>
<dict>
	<key>${projectData.projectId}</key>
	<string>${options.provision}</string>
</dict>`;
            }
            plistTemplate += `
    <key>uploadBitcode</key>
    <false/>
   
    <key>compileBitcode</key>  <!--- Added --->
    <false/>   <!--- Added --->
</dict>
</plist>`;

I know this is a hacky solution and don't think a best solution. If there is more elegant way, please let me know.

@pap5508
Copy link

pap5508 commented Mar 13, 2018

@hosikiti : I am using Nativescript Angular project. I am not able to find ios-project-service.js
Could please let me know that how can I find it.. ??

@hosikiti
Copy link

@pap5508 Check where your tns command is. You can find the location by command: which tns. Tell me the result.

@pap5508
Copy link

pap5508 commented Mar 13, 2018

@hosikiti :

admin$ which tns
/usr/local/bin/tns

When I write command open /usr/local/bin/

screen shot 2018-03-13 at 16 38 35

@hosikiti
Copy link

@pap5508 Thanks. Then, your ios-project-service.js should be in
/usr/local/lib/node_modules/nativescript/lib/services.

@rosen-vladimirov
Copy link
Contributor

Hey guys, we've applied the mentioned change in ios-project-service, so you will no longer have to modify the source code of your CLI. The fix will be included in the next official release.

@rosen-vladimirov rosen-vladimirov self-assigned this Jul 19, 2018
@rosen-vladimirov rosen-vladimirov added this to the 4.2.0 milestone Jul 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants