Description:
When i try to use the classic way to launch an ionic app into a device (ionic cordova run android --device) builds perfectly but native-run fails locating the app source file. The built app is in
platforms/android/build/outputs/apk/android-debug.apk
but the native-run goes to
platforms\android\app\build\outputs\apk\debug\app-debug.apk
looking for a folder called app inside android that does not exist
Steps to Reproduce:
Run ionic cordova run android --device
Output:
BUILD SUCCESSFUL
Total time: 18.968 secs
Built the following apk(s):
D:/Projects/lvlLite-ionic4/platforms/android/build/outputs/apk/android-debug.apk
> native-run.cmd android --app platforms\android\app\build\outputs\apk\debug\app-debug.apk
No hardare devices found, attempting emulator...
Selected emulator PM1LHMA7C2202496
Error: ENOENT: no such file or directory, open 'D:\Projects\lvlLite-ionic4\platforms\android\app\build\outputs\apk\debug\app-debug.apk'
[ERROR] An error occurred while running subprocess native-run.
native-run.cmd android --app platforms\android\app\build\outputs\apk\debug\app-d... exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
My ionic info:
Ionic:
Ionic CLI : 5.0.0 (C:\Users\alvar\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.4.2
@angular-devkit/build-angular : 0.12.4
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.2.4
@ionic/angular-toolkit : 1.3.0
Cordova:
Cordova CLI : 9.0.0 ([email protected])
Cordova Platforms : android 6.3.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 10 other plugins)
Utility:
cordova-res : not installed
native-run : 0.2.2
System:
Android SDK Tools : 26.1.1 (C:\Users\alvar\AppData\Local\Android\Sdk)
NodeJS : v11.6.0 (C:\Program Files\nodejs\node.exe)
npm : 6.5.0-next.0
OS : Windows 10
Other Information:
My workaround to this was use
ionic cordova run android --no-native-run
and works as usual
@alvarofelipe12 Update your android platform to 7 or 8.
ionic cordova platform rm android
ionic cordova platform add android
And what if I want to use the 7...
On Mon, Jun 3, 2019, 2:34 PM dwieeb notifications@github.com wrote:
@alvarofelipe12 https://github.com/alvarofelipe12 Update your android
platform to 7 or 8.ionic cordova platform rm android
ionic cordova platform add android—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ionic-team/ionic-cli/issues/4002?email_source=notifications&email_token=ADMT77BLMQGLFMNWL335A5TPYVW2ZA5CNFSM4HSA4XS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODW2OQVQ#issuecomment-498395222,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADMT77BKPNRVQGF4UBW2KM3PYVW2ZANCNFSM4HSA4XSQ
.
cordova-android 7 is supported. It should work.
The same with cordova updated after Ionic update to 5.0.1
Ionic info:
Ionic CLI : 5.0.1 (C:\Users\Pietro\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.2.0
@angular-devkit/build-angular : 0.13.8
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.3.8
@ionic/angular-toolkit : 1.4.1
Cordova:
Cordova CLI : 9.0.0 ([email protected])
Cordova Platforms : android 8.0.0
Cordova Plugins : not available
Utility:
cordova-res : not installed
native-run : 0.2.2
System:
NodeJS : v10.16.0 (C:\Program Files\nodejs\node.exe)
npm : 6.9.0
OS : Windows 10
@pimol cordova-android 8 works for me. What command are you running? Can you confirm the location of the .apk file?
cordova-android 7 is supported. It should work.
sorry i meant 6.3.0
This error here when execute ionic cordova run android:
`Error: Command failed: C:\Users\nuria\AppData\Local\Android\Sdk\platform-tools/adb -s RF8M204LVHX shell getprop
at ChildProcess.exithandler (child_process.js:294:12)
at ChildProcess.emit (events.js:189:13)
at maybeClose (internal/child_process.js:970:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
[ERROR] An error occurred while running subprocess native-run.
native-run.cmd android --app platforms\android\app\build\outputs\apk\debug\app-d... exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.`
And I have all the packages installed
I am also facing these problems
`ionic info
Ionic:
Ionic CLI : 5.0.1 (C:\Users\sabadi\AppData\Roaming\npmnode_modules\ionic)
Ionic Framework : @ionic/angular 4.1.2
@angular-devkit/build-angular : 0.12.4
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.2.4
@ionic/angular-toolkit : 1.3.0
Cordova:
Cordova CLI : 8.1.2 ([email protected])
Cordova Platforms : android 7.1.4
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 6 other plugins)
Utility:
cordova-res : 0.3.0
native-run : 0.2.3
System:
Android SDK Tools : 26.1.1 (C:\Users\sabadi\AppData\Local\Android\Sdk)
NodeJS : v8.11.3 (C:\Program Files\nodejs\node.exe)
npm : 6.5.0
OS : Windows 10`
@alvarofelipe12 If you need to use cordova-android 6, you should use the --no-native-run flag for now.
@vagnersabadi Can you post log output? If you're getting this issue with cordova-android 7, then something is wrong.
`
@alvarofelipe12 If you need to use cordova-android 6, you should use the
--no-native-runflag for now.@vagnersabadi Can you post log output? If you're getting this issue with cordova-android 7, then something is wrong.
ionic cordova run android --verbose
ionic:lib Terminal info: { ci: false, shell: 'C:\WINDOWS\system32\cmd.exe', tty: true, windows: true } +0ms
ionic:lib CLI global options: { _: [ 'cordova', 'run', 'android' ], help: null, h: null, verbose: true, quiet: null, interactive: true, color: true, confirm: null, json: null, project: null, '--': [] } +5ms
ionic:lib:project Project type from config: @ionic/angular (angular) +0ms
ionic:lib:project Project details: { configPath: 'E:\Documents\Projetos\IMEXSUL\imexsul-app\ionic.config.json', errors: [], context: 'app', type: 'angular' } +0ms
ionic Context: { binPath: 'C:\Users\sabadi\AppData\Roaming\npm\node_modules\ionic\bin\ionic', libPath: 'C:\Users\sabadi\AppData\Roaming\npm\node_modules\ionic', execPath: 'E:\Documents\Projetos\IMEXSUL\imexsul-app', version: '5.0.2' } +0ms
ionic:lib:integrations:cordova:config Using config.xml: E:\Documents\Projetos\IMEXSUL\imexsul-appconfig.xml +0ms
ionic:commands:run Native platform devices: [] +0ms
ionic:lib:integrations:cordova:config Using config.xml: E:\Documents\Projetos\IMEXSUL\imexsul-appconfig.xml +7s
ionic:lib:telemetry Sending telemetry for command: 'ionic cordova run' [ 'android', '--verbose', '--interactive', '--color' ] +0ms
ionic:lib:build build options: { '--': [],
ionic:lib:build engine: 'cordova',
ionic:lib:build platform: 'android',
ionic:lib:build project: undefined,
ionic:lib:build configuration: undefined,
ionic:lib:build sourcemaps: undefined,
ionic:lib:build cordovaAssets: true,
ionic:lib:build type: 'angular' } +0ms
ionic:lib:hooks Looking for ionic:build:before npm script. +0ms
ionic:lib:build Looking for ionic:build npm script. +9ms
ng.cmd run app:ionic-cordova-build --platform=android
Cannot destructure propertycreateHashof 'undefined' or 'null'.
TypeError: Cannot destructure propertycreateHashof 'undefined' or 'null'.
at Object.(E:\Documents\Projetos\IMEXSUL\imexsul-appnode_modules\mini-css-extract-plugin\dist\index.js:21:5)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.(E:\Documents\Projetos\IMEXSUL\imexsul-appnode_modules\mini-css-extract-plugin\dist\cjs.js:3:18)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
[ERROR] An error occurred while running subprocess ng.
ng.cmd run app:ionic-cordova-build --platform=android exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms
ionic:utils-process onBeforeExit handler: running 1 functions +0ms
ionic:utils-process error while killing process tree for 6488: { Error: Command failed: taskkill /pid 6488
/T /F
ionic:utils-process ERRO: o processo "6488" n�o foi encontrado.
ionic:utils-process
ionic:utils-process at ChildProcess.exithandler (child_process.js:275:12)
ionic:utils-process at emitTwo (events.js:126:13)
ionic:utils-process at ChildProcess.emit (events.js:214:7)
ionic:utils-process at maybeClose (internal/child_process.js:925:16)
ionic:utils-process at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
ionic:utils-process killed: false,
ionic:utils-process code: 128,
ionic:utils-process signal: null,
ionic:utils-process cmd: 'taskkill /pid 6488 /T /F' } +96ms
ionic:utils-process onBeforeExit handler: error from function: { Error: Command failed: taskkill /pid 6488
/T /F
ionic:utils-process ERRO: o processo "6488" n�o foi encontrado.
ionic:utils-process
ionic:utils-process at ChildProcess.exithandler (child_process.js:275:12)
ionic:utils-process at emitTwo (events.js:126:13)
ionic:utils-process at ChildProcess.emit (events.js:214:7)
ionic:utils-process at maybeClose (internal/child_process.js:925:16)
ionic:utils-process at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
ionic:utils-process killed: false,
ionic:utils-process code: 128,
ionic:utils-process signal: null,
ionic:utils-process cmd: 'taskkill /pid 6488 /T /F' } +2ms
ionic:utils-process processExit: exiting (exit code: 1) +2ms
I think I found a solution, actually until 05/29/2019 I was using version 4.12.0 after this day my CLI was updated to version 5.0.0 and second this documentation has undergone many changes.If anyone has this problem read the release notes (which I did not do) to see if there is any change
@pimol cordova-android 8 works for me. What command are you running? Can you confirm the location of the
.apkfile?
Sorry, I read only now. Solved with ionic 5.03
It sounds like all the issues here are resolved, so I'm closing this. Let me know if there are other issues.
This keeps happening even in new cli's
```Ionic:
Ionic CLI : 5.2.3 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0
Cordova:
Cordova CLI : 8.0.0
Cordova Platforms : android 6.4.0, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.0.0, (and 19 other plugins)
Utility:
cordova-res : 0.6.0
native-run : 0.2.8
System:
Android SDK Tools : 26.1.1 (/Users/uva3/Library/Android/sdk)
ios-deploy : 1.9.4
NodeJS : v10.16.0 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS Mojave
Xcode : Xcode 10.2.1 Build version 10E1001```
@alvarofelipe12 I explained what you need to do to continue using cordova-android 6: https://github.com/ionic-team/ionic-cli/issues/4002#issuecomment-500536615
I had the same problem, elra a permission problem from the Gradle bin folder. I solved it by giving it permission to execute the folder bin.
How do you change your permissions? I tried ionic cordova run android --no-native-run but it gives me back a blank screen...
Try this,
first run : ionic cordova build android --release
then : ionic cordova run --device
Note : In some case, check your internet connection before executing above command
I had this issue as well
native-run] Error: ENOENT: no such file or directory, open 'platforms/android/app/build/outputs/apk/debug/app-debug.apk'
[ERROR] An error occurred while running subprocess native-run.
native-run android --app platforms/android/app/build/outputs/apk/debug/app-debug... exited with exit code 1.
but my issue was connected with cordova building several apk's for each architecture,
with ...-debug.apk in each of those folders.
Built the following apk(s):
..../platforms/android/app/build/outputs/apk/arm64/debug/app-arm64-debug.apk
..../platforms/android/app/build/outputs/apk/armeabi/debug/app-armeabi-debug.apk
..../platforms/android/app/build/outputs/apk/armv7/debug/app-armv7-debug.apk
..../platforms/android/app/build/outputs/apk/x86/debug/app-x86-debug.apk
..../platforms/android/app/build/outputs/apk/x86_64/debug/app-x86_64-debug.apk
apparently, native-run was looking for a non-existent folder platforms/android/app/build/outputs/apk/debug
here guys on SO explained that the issue is connected to cordova-plugin-crosswalk-webview and to avoid multiple apks - you should run
$ ionic cordova plugin rm cordova-plugin-crosswalk-webview $ ionic cordova platform rm android $ ionic cordova run android --debug -land afterwards it builds this file with correct path:
platforms/android/app/build/outputs/apk/debug/app-debug.apk
and not the
/platforms/android/app/build/outputs/apk/arm64/debug/app-arm64-debug.apk
P.S> Though, I'm not sure how to help Cordova to work correctly with that plugin, and where to report this issue.
Most helpful comment
@alvarofelipe12 If you need to use cordova-android 6, you should use the
--no-native-runflag for now.@vagnersabadi Can you post log output? If you're getting this issue with cordova-android 7, then something is wrong.