Closed tsonevn closed 5 years ago
Hi @gavande, Try to clear up the project and then to rebuild it. Check out the steps below:
node_modules
, platforms
, hooks
folders, webpack.config.js
and package-lock.json
files.npm install
tns run <platform name> --bundle
@tsonevn Thanks for the reply.
I have tried this multiple times. but no luck.
Hi @gavande, Can you send us the project or sample one, which can be used for recreating the issue?
@tsonevn Here is the link to Project my observation says that there is an issue with either live reload or webpack.
HI @gavande,
Thank you for the sample project. I built it on my side, however, was unable to recreate the problem.
I also reviewed the info in your very first comment, and I have noticed that you are mentioning that the error appears when you interrupt the build and then start again the tns run android --bundle
command. If this is the case, the problem might be related to the fact that the CLI is trying to access some corrupted folder or files.
Regarding that, can you try clearing up the project while following the provided steps in my previous comment and build the project again with tns run android --bundle
without interrupting the build process.
Let me know if I am missing something.
closing due to inactivity
I still have this issue, and a LOT more ! Can't build build for Android. Last week it worked for iOS, today it doesn't and throws this error: Unable to apply changes on device: ***. Error is: cp: no such file or directory: /platforms/android/***/app/*.
Same issue, I am on nativescript-vue!
HI @HugoAntares @ngstwr, Try to clear up the project and then to rebuild it. Check out my previous comment. Also, can you provide more info about the exact steps, that you are using, while building the app?
Getting this a lot as well.
Unable to apply changes on device: emulator-5554. Error is: cp: cannot create directory '/Users/daniel-op/development/nativescript/SimpleStats/platforms/android/app/src': No such file or directory.
Will emit event liveSyncError with data { error: Error: cp: cannot create directory '/Users/daniel-op/development/nativescript/SimpleStats/platforms/android/app/src': No such file or directory
at Object.error (/usr/local/lib/node_modules/nativescript/node_modules/shelljs/src/common.js:112:27)
at /usr/local/lib/node_modules/nativescript/node_modules/shelljs/src/cp.js:246:18
at Array.forEach (<anonymous>)
at Object._cp (/usr/local/lib/node_modules/nativescript/node_modules/shelljs/src/cp.js:225:11)
at Object.cp (/usr/local/lib/node_modules/nativescript/node_modules/shelljs/src/common.js:365:25)
at FileSystem.copyFile (/usr/local/lib/node_modules/nativescript/lib/common/file-system.js:220:17)
at PreparePlatformNativeService.prepareAppResources (/usr/local/lib/node_modules/nativescript/lib/services/prepare-platform-native-service.js:86:30)
at PreparePlatformNativeService.<anonymous> (/usr/local/lib/node_modules/nativescript/lib/services/prepare-platform-native-service.js:44:22)
at Generator.next (<anonymous>)
at fulfilled (/usr/local/lib/node_modules/nativescript/lib/services/prepare-platform-native-service.js:10:58)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:160:7),
deviceIdentifier: 'emulator-5554',
projectDir: '/Users/daniel-op/development/nativescript/SimpleStats',
applicationIdentifier: 'net.danielkvist.simplestats' }
Project dir from hooksArgs is: /Users/daniel-op/development/nativescript/SimpleStats.
Removing platforms directory always solves it.
I get the error every time I ctrl-c out of tns run
and then try to run again. Been trying to use lsof
to find out if another file is locking the directory because it does really exist.
I'm on latest node and tns. Will keep an eye out for what is causing it.
Getting this a lot as well.
Unable to apply changes on device: emulator-5554. Error is: cp: cannot create directory '/Users/daniel-op/development/nativescript/SimpleStats/platforms/android/app/src': No such file or directory. Will emit event liveSyncError with data { error: Error: cp: cannot create directory '/Users/daniel-op/development/nativescript/SimpleStats/platforms/android/app/src': No such file or directory at Object.error (/usr/local/lib/node_modules/nativescript/node_modules/shelljs/src/common.js:112:27) at /usr/local/lib/node_modules/nativescript/node_modules/shelljs/src/cp.js:246:18 at Array.forEach (<anonymous>) at Object._cp (/usr/local/lib/node_modules/nativescript/node_modules/shelljs/src/cp.js:225:11) at Object.cp (/usr/local/lib/node_modules/nativescript/node_modules/shelljs/src/common.js:365:25) at FileSystem.copyFile (/usr/local/lib/node_modules/nativescript/lib/common/file-system.js:220:17) at PreparePlatformNativeService.prepareAppResources (/usr/local/lib/node_modules/nativescript/lib/services/prepare-platform-native-service.js:86:30) at PreparePlatformNativeService.<anonymous> (/usr/local/lib/node_modules/nativescript/lib/services/prepare-platform-native-service.js:44:22) at Generator.next (<anonymous>) at fulfilled (/usr/local/lib/node_modules/nativescript/lib/services/prepare-platform-native-service.js:10:58) at <anonymous> at process._tickCallback (internal/process/next_tick.js:160:7), deviceIdentifier: 'emulator-5554', projectDir: '/Users/daniel-op/development/nativescript/SimpleStats', applicationIdentifier: 'net.danielkvist.simplestats' } Project dir from hooksArgs is: /Users/daniel-op/development/nativescript/SimpleStats.
Removing platforms directory always solves it.
I get the error every time I ctrl-c out of
tns run
and then try to run again. Been trying to uselsof
to find out if another file is locking the directory because it does really exist.I'm on latest node and tns. Will keep an eye out for what is causing it.
Same here on Nativescript-vue.
When I run tns platform clean android
it works, but its annoying to clean everytime i quit from tns run
Can this be re-opened? I also have to run tns platform clean android
in my NativeScript-Angular project before running any tns debug android
-- huge burden when testing across multiple devices. This will also happen when doing something like:
tns platform clean android
tns debug android --bundle --device some-device
<-- Successful
tns debug android --bundle --device some-other-device
<-- Executed in a different terminal window, fails
Whether or not that flow is appropriate, I think it may also hint at a failed attempt to access locked/corrupt files.
NativeScript CLI 6.0.2 tns-ios / tns-android 6.0.1
"dependencies": {
"@angular/animations": "~8.0.0",
"@angular/common": "~8.0.0",
"@angular/compiler": "~8.0.0",
"@angular/core": "~8.0.0",
"@angular/forms": "~8.0.0",
"@angular/http": "~8.0.0-beta.10",
"@angular/platform-browser": "~8.0.0",
"@angular/platform-browser-dynamic": "~8.0.0",
"@angular/router": "~8.0.0",
"nativescript-angular": "~8.0.0",
"nativescript-oauth2": "^1.4.3",
"nativescript-theme-core": "~1.0.6",
"nativescript-ui-dataform": "5.0.0",
"nativescript-ui-gauge": "5.0.0",
"nativescript-ui-listview": "7.0.1",
"reflect-metadata": "~0.1.12",
"rxjs": "~6.5.0",
"rxjs-compat": "^6.5.2",
"tns-core-modules": "~6.0.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular/compiler-cli": "~8.0.0",
"@ngtools/webpack": "~8.0.0",
"nativescript-dev-webpack": "~1.0.0",
"typescript": "~3.4.0"
}
Hi @dscirto, Can you open a new issue about the problem you are facing? It will help if you provide a sample project, that can be used for debugging as well as more info about the device that you are using for testing.
@tsonevn sure thing -- I'll try and get to this by the end of the week
I have the same issue after falsly(?) using tns resources generate icons
I have entered the wrong image directory and the error message is keep poping the false directory I have entered before, and it did not get away after cleaning process mentioned above
Removed all hooks, node_modules, webpack config, removed and readded platform and still receiving the error that the directory cannot be created. I suspect it has something to do with android assets as I recently added new images to the app_resources folder
@Mixelated yes, I think you are right, this happens when I add images into App_Resources/Android/src/main/res simply deleting the image solved the problem, but after deleting the image, I can still use it by accessing 'res://yourImagename'.
Perhaps I will try that. Did you try making a production build to see if the image is still available?
@Mixelated yes I've tried it and it worked, unless you don't executetns platform clean android
I had the same issue.
The problem was that when adding images to Android resources, the images needed to have Read&Write permissions. Having Read Only permissions was giving me that error.
@gavande commented on Tue Oct 30 2018
Environment Provide version numbers for the following components (information can be retrieved by running
tns info
in your project folder or by inspecting thepackage.json
of the project):Describe the bug
tns run android --bundle
is giving me following error:Unable to apply changes on device:*. Error is: cp: cannot create directory '/platforms/android/app/src': No such file or directory.
If I delete platforms folder and then run above command then it does not give any error. But once I stop the command and rerun same command gives above error.
Same issue is with iOS platform.
I have deleted node_modules, hooks, platforms folders and then tried to run but same issue.
I have tried upgrade webpack to the latest version but It also didn't work.
Additional context
Here is console after running command: