nativescript-cli icon indicating copy to clipboard operation
nativescript-cli copied to clipboard

Solution : Unable to apply changes on device .. Unable to get application path on device..

Open NickIliev opened this issue 7 years ago • 26 comments

@saxdevweb commented on Sun Nov 04 2018

I have the same problem I solved it as I explain in the picture. capture d ecran 2018-11-03 a 23 26 08

Describe the solution you'd like 4- Once you have crushed the state of emulation. 5- Exit and close the emulator. 6- Restart the command: $ tns run ios

Normally the phone will completely reset itself to reinstall the application.

Describe alternatives you've considered i' havent alternative

NickIliev avatar Nov 05 '18 07:11 NickIliev

Have you figured what's the problem? It is now impossible for me to work on iOS as the simulator needs to be erased every time I make a change on my Mojave MacBook and every time I make major changes on my High Sierra iMac. Let me know if you need more information.

Thank you for working on this issue.

jfturcot avatar Jan 18 '19 20:01 jfturcot

Hi @jfturcot,

We released [email protected] version with various fixes related to issues with iOS simulator. I suggest you to install it on your side and give it a try.

Fatme avatar Jan 21 '19 10:01 Fatme

@Fatme Thank you for replying. I installed it today, worked for the first couple of builds, then it broke again and I got the same error as before. It works fine when I do not --bundle the app.

jfturcot avatar Jan 21 '19 18:01 jfturcot

+1 for this issue, I'm running into the same (or a similar) bug. Webpack watches for changes, and often succeeds in reloading the app. However, after like 10 changes, the app won't reload, and I need to cancel the build process and restart it again. Every time I perform this manual action, I get the Unable to apply changes on device error. I then have to remove the app from the device, and sometimes even erase the content from the simulator, before the build process will work again.

This happens pretty often and thus is a major annoyance during development. Colleagues working on the same projects don't run into this. I have tried reinstalling the Nativescript CLI but this hasn't resolved the issue.

JillevdW avatar Feb 18 '19 09:02 JillevdW

+1. Having the same problem with NativeScript version 5.2.0.

JonLevy avatar Feb 24 '19 23:02 JonLevy

+1, have the same problem too. One workaround I found is to open XCode ( open platforms/ios/MyApp.xcworkspace/ ) and build/run with xcode. Then stop and tns works again.

lolgzs avatar Mar 19 '19 08:03 lolgzs

Hey @lolgzs , The issue happens when for some reason the iOS Simulator gets blocked by the requests CLI sends to it. In the last several versions of NativeScript CLI we've tried to fix this behavior and we are unable to reproduce it on our side at the moment. Of course, this doesn't mean we've fixed all cases, but we'll need some more details about your environment and the way you reproduce the error. Can you please send us the following information:

  1. CLI version (output of tns --version)
  2. Xcode version (output of xcodebuild -version)
  3. Steps to reproduce the issue - every action and command you execute on your side to reproduce it.
  4. The project with which you reproduce the issue - as it might be related to the size of the application.
  5. Does the issue reproduce with simple Hello World application?
  6. Does the issue reproduce with all simulators you have or with a specific one? Does the issue occur after you Erase the content of the simulator?
  7. What is the simulator with which you reproduce the error, i.e. its OS version and device type?

rosen-vladimirov avatar Mar 19 '19 10:03 rosen-vladimirov

Issue arises in 5.3.1 build too. Experienced exact problem after upgrade. Though @NickIliev solution worked in my case. Version details below for debugging.

Versions

tns version 5.3.0
tns-core-modules 5.3.1
tns-android 5.3.0
tns-ios 5.3.1
Xcode 10.1
Build version 10B61

Steps tns run ios --emulator

Simulator

iOS 12.1 
Device iPhone 6

isawk avatar Apr 03 '19 11:04 isawk

I am having this issue, don't know if its related:

Project successfully built.
Installing on device 21D9962B-8EE6-425B-A030-13CF19E6AB69...
Successfully installed on device with identifier '21D9962B-8EE6-425B-A030-13CF19E6AB69'.
Unable to apply changes on device: 21D9962B-8EE6-425B-A030-13CF19E6AB69. Error is: cp: no such file or directory: /Users/relvis/Projects/NSProjects/MyProject/platforms/ios/MyProject/app/*.

This is my tns-doctor result:

✔ Getting environment information 

No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 10.2.1 satisfies minimum required version 9.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 5.3.4 version and is up to date.
✔ Component tns-core-modules has 5.3.2 version and is up to date.
✔ Component tns-android has 5.3.1 version and is up to date.
✔ Component tns-ios has 5.3.1 version and is up to date.

Any suggestions?

relez avatar May 09 '19 17:05 relez

Hey, can you execute tns run ios --log trace --justlaunch >out.txt and send us the generated file

rosen-vladimirov avatar May 09 '19 17:05 rosen-vladimirov

Also can you provide the information required in my previous comment: https://github.com/NativeScript/nativescript-cli/issues/4095#issuecomment-474289922

rosen-vladimirov avatar May 09 '19 17:05 rosen-vladimirov

tns version 5.3.4
tns-core-modules 5.3.1
tns-android 5.3.1
tns-ios 5.3.1
Xcode 10.2.1
Build version 10E1001

How can I send you the out.txt file?

relez avatar May 09 '19 17:05 relez

Somehow webpack wasn't working, don't know why, but I pull the old version from github and it's fine now. Thanks!

relez avatar May 09 '19 19:05 relez

I am getting the same issue and unable to run it.

I m having version 5.4.2 of NativeScript

Here is my package.json

"dependencies": {
    "@angular/animations": "~8.0.0",
    "@angular/cdk": "^8.0.1",
    "@angular/common": "~8.0.0",
    "@angular/compiler": "~8.0.0",
    "@angular/core": "~8.0.0",
    "@angular/forms": "~8.0.0",
    "@angular/platform-browser": "~8.0.0",
    "@angular/platform-browser-dynamic": "~8.0.0",
    "@angular/router": "~8.0.0",
    "nativescript-angular": "~7.2.0",
    "nativescript-theme-core": "~1.0.4",
    "ng-zorro-antd": "^7.5.0",
    "reflect-metadata": "~0.1.12",
    "rxjs": "~6.4.0",
    "tns-core-modules": "^5.4.2",
    "tslib": "^1.9.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "nativescript-dev-webpack": "^0.20.0",
    "@nativescript/schematics": "~0.4.0",
    "@angular-devkit/build-angular": "~0.800.0",
    "@angular/cli": "~8.0.2",
    "@angular/compiler-cli": "~8.0.0",
    "@angular/language-service": "~8.0.0",
    "@types/node": "~8.9.4",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "codelyzer": "^5.0.0",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.15.0",
    "typescript": "~3.4.3"
  },
  "nativescript": {
    "id": "org.nativescript.ngsample",
    "tns-ios": {
      "version": "5.4.1"
    },
    "tns-android": {
      "version": "5.4.0"
    }
  }

And here is my tns doctor

✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 10.2.1 satisfies minimum required version 9.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 5.4.0 version and is up to date.
✔ Component tns-core-modules has 5.4.2 version and is up to date.
✔ Component tns-android has 5.4.0 version and is up to date.
✔ Component tns-ios has 5.4.1 version and is up to date.

Please let me know if I can provide more info. I couldn't get much out of trace as well.

Update After machine restart it started working for me. It is weird and completely random.

kunjee17 avatar Jun 13 '19 06:06 kunjee17

@relez I am having a similar problem, and I think it began when I updated webpack a few days ago. You said you pulled the old version from github and that helped. Can you tell me what you did and what version you are using now?

NL33 avatar Jun 16 '19 13:06 NL33

Hey @NL33, I fixed the issue copying the webpack config sample from node_modules/nativescript-dev-webpack/templates/webpack.angular.js to the app folder and renamed to webpack.config.js.

That solved the problem!

Thanks!

relez avatar Jun 17 '19 13:06 relez

Similar/Same Issue on latest nativescript

Command

tns run ios --emulator --bundle

Error

Unable to apply changes on device: E318C403-80AD-4620-849A-FFD870A2D8CD. Error is: Command xcodebuild failed with exit code 65.

Full Error

Command Ld failed with a nonzero exit code
Traceback (most recent call last):
  File "./build-step-metadata-generator.py", line 128, in <module>
    generate_metadata(arch)
  File "./build-step-metadata-generator.py", line 109, in generate_metadata
    error_stream_content = child_process.communicate()[1]
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 794, in communicate
    stderr = _eintr_retry_call(self.stderr.read)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 476, in _eintr_retry_call
    return func(*args)
KeyboardInterrupt
Command Ld failed with a nonzero exit code
note: Using new build systemnote: Planning buildnote: Constructing build description
** BUILD FAILED **

Unable to apply changes on device: E318C403-80AD-4620-849A-FFD870A2D8CD. Error is: Command xcodebuild failed with exit code 65.

Version Info

  • nativescript 6.0.3
  • tns-core-modules 6.0.7
  • tns-android 6.0.2
  • tns-ios 6.0.2
  • npm version 6.10.3
  • xcode Xcode 10.3 Build version 10G8

isawk avatar Aug 26 '19 16:08 isawk

Same issue. NS5 5.3.1. Previously erasing hardware data worked for me. But, I had to update my provisioning profile. Since then, I get the "unable to apply changes on device...Error is: Unable to get application path on device..." error on the simulator. Erasing hardware, restarting, etc. does not work any more.

Everything works fine running the simulator directly from xcode or running it on an actual device. But $ tns run ios leads to this error on the simulator.

NL33 avatar Sep 07 '19 20:09 NL33

The following worked for me to get my app running on the iOS simulator (at least today): specifying the device.

So, instead of $ tns run ios , I ran $ tns run ios --device "iPhone SE" (specific device probably doesn't matter). This command led to successfully installing the app on the simulator.

NL33 avatar Sep 08 '19 19:09 NL33

Remove node_modules, hooks and platforms folder using this command rm -rf node_modules/ hooks/ platforms/ . Then yarn install/npm install and run the application. It will fix the issue.

hamzaehsan95 avatar Apr 09 '20 12:04 hamzaehsan95

Updating runtime package.json with configuration values...
Project successfully prepared (ios)
Unable to apply changes on device: 1051A25B-1CB6-4384-BC65-7B43CD5CDC31. Error is: ENOENT: no such file or directory, scandir '/Users/surajbharti/Library/Developer/CoreSimulator/Devices/1051A25C-1CB6-4384-BC65-7B43CD5CDC31/data/Applications'.

I was getting the same error, and the solution was very simple, there was missing Application folder in the data folder. So just created an Applications folder in the data folder and then run tns run ios It worked 👍

suraj-bharti avatar Sep 23 '20 15:09 suraj-bharti

Updating runtime package.json with configuration values...
Project successfully prepared (ios)
Unable to apply changes on device: 1051A25B-1CB6-4384-BC65-7B43CD5CDC31. Error is: ENOENT: no such file or directory, scandir '/Users/surajbharti/Library/Developer/CoreSimulator/Devices/1051A25C-1CB6-4384-BC65-7B43CD5CDC31/data/Applications'.

I was getting the same error, and the solution was very simple, there was missing Application folder in the data folder. So just created an Applications folder in the data folder and then run tns run ios It worked 👍

@suraj-bharti Could you elaborate on that a bit more? Where exactly do I have to create the folder? Get error

Unable to apply changes on device: XXXXXXXXXX. Error is: ENOENT: no such file or directory, scandir '/Users/username/Library/Developer/CoreSimulator/Devices/XXXXXXXXXX/data/Applications'.

I am using Nativescript 7 with Xcode 12.0.1 (OS Catalina 10.15.6)

Thanks in advance :)

fabfischer avatar Sep 27 '20 16:09 fabfischer

Updating runtime package.json with configuration values...
Project successfully prepared (ios)
Unable to apply changes on device: 1051A25B-1CB6-4384-BC65-7B43CD5CDC31. Error is: ENOENT: no such file or directory, scandir '/Users/surajbharti/Library/Developer/CoreSimulator/Devices/1051A25C-1CB6-4384-BC65-7B43CD5CDC31/data/Applications'.

I was getting the same error, and the solution was very simple, there was missing Application folder in the data folder. So just created an Applications folder in the data folder and then run tns run ios It worked 👍

@suraj-bharti Could you elaborate on that a bit more? Where exactly do I have to create the folder? Get error

Unable to apply changes on device: XXXXXXXXXX. Error is: ENOENT: no such file or directory, scandir '/Users/username/Library/Developer/CoreSimulator/Devices/XXXXXXXXXX/data/Applications'.

I am using Nativescript 7 with Xcode 12.0.1 (OS Catalina 10.15.6)

Thanks in advance :)

This solution worked for me. I am using the same environment as you.

Basically @suraj-bharti is saying is when you get the error copy up to data dir and manually create the Applications folder e.g.

cd /Users/username/Library/Developer/CoreSimulator/Devices/XXXXXXXXXX/data; mkdir Applications;

and rerun. No idea if permissions for this are missing or what the deal is.

aedanmcgarry avatar Sep 29 '20 08:09 aedanmcgarry

Updating runtime package.json with configuration values...
Project successfully prepared (ios)
Unable to apply changes on device: 1051A25B-1CB6-4384-BC65-7B43CD5CDC31. Error is: ENOENT: no such file or directory, scandir '/Users/surajbharti/Library/Developer/CoreSimulator/Devices/1051A25C-1CB6-4384-BC65-7B43CD5CDC31/data/Applications'.

I was getting the same error, and the solution was very simple, there was missing Application folder in the data folder. So just created an Applications folder in the data folder and then run tns run ios It worked 👍

@suraj-bharti Could you elaborate on that a bit more? Where exactly do I have to create the folder? Get error

Unable to apply changes on device: XXXXXXXXXX. Error is: ENOENT: no such file or directory, scandir '/Users/username/Library/Developer/CoreSimulator/Devices/XXXXXXXXXX/data/Applications'.

I am using Nativescript 7 with Xcode 12.0.1 (OS Catalina 10.15.6) Thanks in advance :)

This solution worked for me. I am using the same environment as you.

Basically @suraj-bharti is saying is when you get the error copy up to data dir and manually create the Applications folder e.g.

cd /Users/username/Library/Developer/CoreSimulator/Devices/XXXXXXXXXX/data; mkdir Applications;

and rerun. No idea if permissions for this are missing or what the deal is.

@chirprooms Thank you very much! It didn't occur to me that I should actually do something on my local filesystem - I thought I had to do something in the emulator. With that it works perfectly. Thanks a lot!

fabfischer avatar Sep 29 '20 14:09 fabfischer

Users/username/Library/Developer/CoreSimulator/Devices/XXXXXXXXXX/data/Applications

Basically, I want to say, we are getting the error because there no Application folder at that location. So, just create that folder that's all. mkdir -p Users/username/Library/Developer/CoreSimulator/Devices/XXXXXXXXXX/data/Applications

suraj-bharti avatar Sep 29 '20 14:09 suraj-bharti

Cross post with cause and solution in NS 9.0.0 https://github.com/NativeScript/NativeScript/issues/5728#issuecomment-3567945355

flipperlite avatar Nov 23 '25 13:11 flipperlite