Issue
I'm trying to get a brand new set up in place to run the example Ionic 4 app on an android device. I'm running on a brand new iMac and have installed all the needed prerequisites (ionic cli, npm, JDK8, Gradle, Android SDK, set up environmental variables, etc.) All latest version, fresh install.
I'm able to create the example app, add android platform, and build fine. But when I try to run to a device I get this error:
cordova build android native-run android --app platforms/android/app/build/outputs/apk/debug/app-debug.apk --forward 8100:8100 [native-run] Error: spawn /Users/mike/Library/Android/sdk/platform-tools/adb ENOENT [native-run] at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19) [native-run] at onErrorNT (internal/child_process.js:469:16) [native-run] at processTicksAndRejections (internal/process/task_queues.js:84:21) [ERROR] An error occurred while running subprocess native-run.
What concerns me is the file path shown (.../sdk/platform-tools/adb) is different from where I see the location when navigating there myself (i.e. the fresh install of Android Studio has this at the location .../sdk/platform-tools/platform-tools/adb .... (note the extra "platform-tools" folder.
When I run "adb devices" it works, but only when I have the environmental variable (PATH) set to .../platform-tools/platform-tools/adb but when I try the ionic run command its obviously trying the other location. How? Why? What did I install wrong???
Solution
After much toiling... final step was to completely uninstall and remove all components of Android Studio, then reinstall again. This solved it and removed the duplicate folders. No idea how it would have happened on a standard install but if anyone else experiences it, this would be my recommendation.
Answered By - Mike Darling
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.