NativeScript / nativescript-cli

Command-line interface for building NativeScript apps
https://www.npmjs.com/package/nativescript
Apache License 2.0
1.04k stars 195 forks source link

Cannot run on iOS: Command xcrun with arguments simctl install...An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1) #4048

Open s-ale opened 6 years ago

s-ale commented 6 years ago

Environment ✔ Getting NativeScript components versions information... ✔ Component nativescript has 4.2.4 version and is up to date. ✔ Component tns-core-modules has 4.2.1 version and is up to date. ✔ Component tns-android has 4.2.0 version and is up to date. ✔ Component tns-ios has 4.2.0 version and is up to date.

Dependencies:

"dependencies": { "@angular/animations": "~6.0.6", "@angular/common": "~6.0.6", "@angular/compiler": "~6.0.6", "@angular/core": "~6.0.6", "@angular/forms": "~6.0.6", "@angular/http": "~6.0.6", "@angular/platform-browser": "~6.0.6", "@angular/platform-browser-dynamic": "~6.0.6", "@angular/router": "~6.0.6", "nativescript-android-utils": "^1.0.2", "nativescript-angular": "~6.0.6", "nativescript-drop-down": "^4.0.1", "nativescript-geolocation": "^4.3.1", "nativescript-gradient": "^2.0.1", "nativescript-localstorage": "^2.0.0", "nativescript-modal-datetimepicker": "^1.1.7", "nativescript-plugin-firebase": "^7.1.6", "nativescript-theme-core": "~1.0.4", "nativescript-toast": "^1.4.6", "nativescript-ui-sidedrawer": "~4.1.0", "reflect-metadata": "~0.1.10", "rxjs": "~6.1.0", "tns-core-modules": "^4.2.1", "zone.js": "~0.8.18" },

Describe the bug Just finished to configure Firebase for Android to:

It works ok

(Nb. To let "nativescript-plugin-firebase" work with "nativescript-geolocation", I had to write this line in the app.gradle: project.ext { googlePlayServicesVersion = "15.0.1" } )

Now I'm trying to run on iOS (after removing the platform ios from the folder, to let the runner generate it from zero): tns run ios

But I'm getting this error during the installation: Unable to apply changes on device: 314852F5-762C-4287-8565-3081236DB5A0. Error is: Command xcrun with arguments simctl install 314852F5-762C-4287-8565-3081236DB5A0 /Users/alessandro/Documents/Progetti/cmi-app-nativescript/meteo-by-centrometeoitaliano/platforms/ios/build/emulator/meteobycentrometeoitaliano.app failed with exit code 1. Error output: An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1): This app could not be installed at this time. Underlying error (domain=MIInstallerErrorDomain, code=11): Bundle at path /Users/alessandro/Library/Developer/CoreSimulator/Devices/314852F5-762C-4287-8565-3081236DB5A0/data/Library/Caches/com.apple.mobile.installd.staging/temp.RswIpe/extracted/meteobycentrometeoitaliano.app has missing or invalid CFBundleExecutable in its Info.plist

Is there some trouble between nativescript and geolocation also for iOS?

Thank you

Fatme commented 6 years ago

Hi @s-ale,

As we fixed some issues related to xcrun in rc version of {N} CLI, I'd like to ask you to update your NativeScript.

npm un -g nativescript
npm i -g nativescript@rc

Let me know if this fixes the issue on your side.

s-ale commented 6 years ago

Hi @Fatme

Just followed your instructions, but the problem remains. Here's the part of the log around that which I get the error in:

npm run ios --log trace

` ... ... AfterHookName for command shouldPrepare is after-shouldPrepare Skipping prepare. Installing on device 314852F5-762C-4287-8565-3081236DB5A0... Project dir from hooksArgs is: undefined. Hooks directories: [ '/Users/alessandro/Documents/Progetti/cmi-app-nativescript/meteo-by-centrometeoitaliano/hooks' ] BeforeHookName for command install is before-install 12:27:13 - File change detected. Starting incremental compilation... 12:27:14 - Compilation complete. Watching for file changes. 12:27:15 - File change detected. Starting incremental compilation... 12:27:16 - Compilation complete. Watching for file changes. 12:27:19 - File change detected. Starting incremental compilation... 12:27:20 - Compilation complete. Watching for file changes. 12:27:23 - File change detected. Starting incremental compilation... 12:27:23 - Compilation complete. Watching for file changes. 12:27:53 - File change detected. Starting incremental compilation... 12:27:54 - Compilation complete. Watching for file changes. Unable to apply changes on device: 314852F5-762C-4287-8565-3081236DB5A0. Error is: Command xcrun with arguments simctl install 314852F5-762C-4287-8565-3081236DB5A0 /Users/alessandro/Documents/Progetti/cmi-app-nativescript/meteo-by-centrometeoitaliano/platforms/ios/build/emulator/meteobycentrometeoitaliano.app failed with exit code 1. Error output: An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1): This app could not be installed at this time. Underlying error (domain=MIInstallerErrorDomain, code=11): Bundle at path /Users/alessandro/Library/Developer/CoreSimulator/Devices/314852F5-762C-4287-8565-3081236DB5A0/data/Library/Caches/com.apple.mobile.installd.staging/temp.cvgNuZ/extracted/meteobycentrometeoitaliano.app has missing or invalid CFBundleExecutable in its Info.plist . Will emit event liveSyncError with data { error: Error: Command xcrun with arguments simctl install 314852F5-762C-4287-8565-3081236DB5A0 /Users/alessandro/Documents/Progetti/cmi-app-nativescript/meteo-by-centrometeoitaliano/platforms/ios/build/emulator/meteobycentrometeoitaliano.app failed with exit code 1. Error output: An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1): This app could not be installed at this time. Underlying error (domain=MIInstallerErrorDomain, code=11): Bundle at path /Users/alessandro/Library/Developer/CoreSimulator/Devices/314852F5-762C-4287-8565-3081236DB5A0/data/Library/Caches/com.apple.mobile.installd.staging/temp.cvgNuZ/extracted/meteobycentrometeoitaliano.app has missing or invalid CFBundleExecutable in its Info.plist

   at ChildProcess.childProcess.on (/Users/alessandro/.npm-global/lib/node_modules/nativescript/node_modules/ios-sim-portable/lib/child-process.js:56:28)
   at emitTwo (events.js:125:13)
   at ChildProcess.emit (events.js:213:7)
   at maybeClose (internal/child_process.js:897:16)
   at Socket.stream.socket.on (internal/child_process.js:340:11)
   at emitOne (events.js:115:13)
   at Socket.emit (events.js:210:7)
   at Pipe._handle.close [as _onclose] (net.js:549:12),

deviceIdentifier: '314852F5-762C-4287-8565-3081236DB5A0', projectDir: '/Users/alessandro/Documents/Progetti/cmi-app-nativescript/meteo-by-centrometeoitaliano', applicationIdentifier: 'com.meteo.italia' } Project dir from hooksArgs is: /Users/alessandro/Documents/Progetti/cmi-app-nativescript/meteo-by-centrometeoitaliano. Hooks directories: [ '/Users/alessandro/Documents/Progetti/cmi-app-nativescript/meteo-by-centrometeoitaliano/hooks' ] ... ... ... `

I hope that this is gonna be useful

Thanks :)

enrico-atzeni commented 6 years ago

same issue for me

diegozen commented 6 years ago

I'm having this error, but only when using --template tns-template-hello-world on tns create

chrillewoodz commented 6 years ago

Also having this issue, but it didn't start to appear until I tried adding the https://github.com/dapriett/nativescript-google-maps-sdk plugin.

Fatme commented 6 years ago

@s-ale, @enrico-atzeni, @DiegoZen, @chrillewoodz

I removed the following from App_Resources/iOS/Info.plist and was able to reproduce the problem.

<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>

So can you please check if you have the above code in your App_Resources/iOS/Info.plist? Can you please check platforms/iOS/<projectName>/<projectName>-Info.plist as well?

Maybe some hook modifies the Info.plist file under the App_Resources and it remains broken.

liam-nirvana commented 5 years ago

Hey guys, I also have this problem, Is anyone fix it ? please tell me , It's drive me crazy :(

diegozen commented 5 years ago

Deleting platforms/ios folder and do tns run ios worked to me !

rosen-vladimirov commented 5 years ago

Hey guys, do you reproduce the error, can we close this issue?

hamzamalfawaer commented 5 years ago

any solution ?????

rosen-vladimirov commented 5 years ago

@hamzamalfawaer , what is the issue you are facing, do you have steps to reproduce. Please, whenever you ask for help, provide all the required information in the issue template. We cannot help you without getting full information for the issue, circumstances, etc.

hamzamalfawaer commented 5 years ago

@rosen-vladimirov I've changed to nativescript v6 using angular and everything worked perfectly

But still can provide info about previous version of app to help others if faced same problem just let me know which info should I send

rosen-vladimirov commented 5 years ago

Hey @hamzamalfawaer , Can you provide the following information:

hamzamalfawaer commented 5 years ago

@rosen-vladimirov

kleingtm commented 5 years ago

I ran into this when using NS Sidekick and renaming the root directory of my project. If NS Sidekick project name (immutable) and your directory name get out of sync, it can't find it

aosi87 commented 4 years ago

I had the same issue today, i was trying to configure Info.plist, to be more precise:

    <key>CFBundleDisplayName</key>
    <string>${PRODUCT_NAME}</string>
    <key>CFBundleExecutable</key>
    <string>${EXECUTABLE_NAME}</string>

Looks like i cannot set the name in that file, what i end up doing was, let it be, and open xcode do my changes there, generate the build, publish it and no problem, but every time i want to do publish my app ill have to do all this process again.

Any updates on this?

thorvaldemar commented 4 years ago

Has anyone found a solution?

I get this error every time I try to execute tns run ios

Unable to apply changes on device: 8A979AA6-F863-4DBF-9DE4-96ECC5317FDD. Error is: Command xcrun with arguments simctl install 8A979AA6-F863-4DBF-9DE4-96ECC5317FDD /Users/thorbilsby/Desktop/nameit/platforms/ios/build/Debug-iphonesimulator/nameit.app failed with exit code 1. Error output:
 An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1):
This app could not be installed at this time.
Could not install at this time.
Failed to chmod /Users/thorbilsby/Library/Developer/CoreSimulator/Devices/8A979AA6-F863-4DBF-9DE4-96ECC5317FDD/data/Bundle/Application/8C58AEF6-884E-4BEC-A4A2-054E28B2CA18/nameit.app/nameit : No such file or directory
Underlying error (domain=MIInstallerErrorDomain, code=4):
    Failed to chmod /Users/thorbilsby/Library/Developer/CoreSimulator/Devices/8A979AA6-F863-4DBF-9DE4-96ECC5317FDD/data/Bundle/Application/8C58AEF6-884E-4BEC-A4A2-054E28B2CA18/nameit.app/nameit : No such file or directory
pageSwanson commented 3 years ago

I solved this issue by reverting to nativescript 6.8.0 from 7.2.0 I did so after reading the following post - apparently xcode 11.x.x is not supported for nativescript 7

https://nativescript.org/blog/nativescript-6-7-xcode-compatibility/

Posting the details of my original error / environment below - in case it helps others identify the same problem.

Error

Unable to apply changes on device: B389CF57-E430-4111-8C97-0802FE3C73A2. Error is: Command xcrun with arguments simctl install B389CF57-E430-4111-8C97-0802FE3C73A2 Users/xxxx/Documents/dev/library-app-starter/ablankapp/platforms/ios/build/Debug-iphonesimulator/ablankapp.app failed with exit code 1. Error output:
 An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1):
This app could not be installed at this time.
Could not install at this time.
Failed to chmod /Users/xxxx/Library/Developer/CoreSimulator/Devices/B389CF57-E430-4111-8C97-0802FE3C73A2/data/Bundle/Application/26E18A63-5F6D-4E8E-953F-2375E9AD4917/ablankapp.app/ablankapp : No such file or directory
Underlying error (domain=MIInstallerErrorDomain, code=4):
    Failed to chmod /Users/xxxx/Library/Developer/CoreSimulator/Devices/B389CF57-E430-4111-8C97-0802FE3C73A2/data/Bundle/Application/26E18A63-5F6D-4E8E-953F-2375E9AD4917/ablankapp.app/ablankapp : No such file or directory

Environment

To Reproduce

ns create --js npm install ns run ios --emulator

Context I had tried making changes to the Info.plist in App_resources, running ns clean, and 'Erase all content & settings' using the simulator, and I've tried updating the version of nativescript/core

cupidchan commented 3 years ago

I have the same issue even for the latest version: NativeScript: 8.0.1 Xcode: 12.4 iOS: 14.4

javierpal commented 3 years ago

Same here, deleting platforms folder don't seems to work.

tdarr-okbu commented 3 years ago

Same issue for

Any resolution?

msimicshauma commented 3 years ago

Same issue here.

chakravarthiponmudi commented 3 years ago

Same issue here.

aosi87 commented 3 years ago

I figure this issue a few months back, looks like that my project was build using the companion app, then updated to current versions, current versions handle this properties in different files, so be careful when you update or move from one version to another, what i end up doing was to redo my configurations and move my SRC code to the new generated project.

hope this helps.

bitsnaps commented 2 years ago

Same issue here running the default hello app:

Mojave: 10.14.6
Xcode: 11.3.1
iPhone 11 Pro -- Max 13.3

Log (app name: hellonativescriptvue):

Unable to apply changes on device: $DEVICE_ID. Error is: Command xcrun with arguments simctl install $DEVICE_ID /Users/$USER/path/to/app/platforms/ios/build/Debug-iphonesimulator/hellonativescriptvue.app failed with exit code 1. Error output:
 An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1):
This app could not be installed at this time.
Could not install at this time.
Failed to chmod /Users/mac/Library/Developer/CoreSimulator/Devices/$DEVICE_ID/data/Bundle/Application/$APP_ID/hellonativescriptvue.app/hellonativescriptvue : No such file or directory
Underlying error (domain=MIInstallerErrorDomain, code=4):
    Failed to chmod /Users/$USER/Library/Developer/CoreSimulator/Devices/$DEVICE_ID/data/Bundle/Application/$APP_ID/hellonativescriptvue.app/hellonativescriptvue : No such file or directory

The command ns deploy ios raises the same error.