I'm making an Android app with the framework Cordova. It's all right until the command "cordova run". The terminal gives me this error:
ERROR: Failed to launch application on device: ERROR: Failed to install apk to device: pkg: /data/local/tmp/MainActivity-debug.apk
Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
rm failed for -f, No such file or directory
ERROR running one or more of the platforms: Error: /home/francesco/hello/platforms/android/cordova/run: Command failed with exit code 8
You may not have the required environment or OS to run this project
francesco#francesco:~/hello$ adb devices
List of devices attached
LGOTMS79a92e5a device
I'm using Ubuntu 14.04. Thank you in advance for the help.
Related
i am new to flutter and android at all
first i wanted to run basic flutter program on my emulator(memu) android studio does not found memu so i go to memu file location and write this command on cmd:
adb connect localhost:21503
after that i got new error and this is it:
Launching lib\main.dart on G011A in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app.apk...
Error: ADB exited with exit code 1
Performing Streamed Install
adb: failed to install B:\Android\jadi\build\app\outputs\flutter-apk\app.apk: Failure [INSTALL_FAILED_VERIFICATION_FAILURE]
Error launching application on G011A.
what should i do plz help...
I am just starting to create a new react-native project and I followed the steps exactly as mentioned in setting-up environment for react-native.
My development OS: Mac; My target OS: Android
I created a local.properties file in my project/android directory which mentions sdk path. I have the android emulator up and running, then I do yarn react-native start, and in another terminal window, yarn react-native run:android but I get the following error:
BUILD SUCCESSFUL in 28s
27 actionable tasks: 27 executed
info Connecting to the development server...
warn Failed to connect to development server using "adb reverse": spawnSync adb ENOENT
info Starting the app...
error Failed to start the app. Run CLI with --verbose flag for more details.
Error: spawnSync adb ENOENT
at Object.spawnSync (internal/child_process.js:1066:20)
error Command failed with exit code 1.
yarn react-native run:ios command runs perfectly alright.
Could anyone help with this please? I have tried the various different suggestions mentioned in this stackoverflow question but no luck.
Im building an app on ionic, my problem is that I want to see the console logs in real time when I launch the app on my android phone.
I used this command:
sudo ionic cordova run android
It launchs the app without problem. But looking on internet I saw that if I add -lI can see the logs while the app is running on my phone. The problem is that when I execute:
sudo ionic cordova run android -l
It shows this error:
> cordova build android --device
[INFO] ... and 77 additional chunks
[ng] ℹ 「wdm」: Compiled successfully.
> native-run android --app platforms/android/app/build/outputs/apk/debug/app-debug.apk --device --forward 8100:8100
[native-run] Selected hardware device 1c675858050c
[native-run] Error: Command failed: /root/Android/Sdk/platform-tools/adb -s 1c675858050c reverse tcp:8100 tcp:8100
[native-run] adb: error: closed
[native-run]
[native-run] at ChildProcess.exithandler (child_process.js:303:12)
[native-run] at ChildProcess.emit (events.js:321:20)
[native-run] at maybeClose (internal/child_process.js:1026:16)
[native-run] at Socket.<anonymous> (internal/child_process.js:441:11)
[native-run] at Socket.emit (events.js:321:20)
[native-run] at Pipe.<anonymous> (net.js:668:12)
[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.
Re-running this command with the --verbose flag may provide more information.
How can I solve it? Or am I doing something wrong to see the logs in console while I use the ap on my phone?
Thanks!
Connect Your Device via Cable or adb to run your application build.
After installation:
1) Open Chrome in your PC and type chrome://inspect/ you will a list you connected devices.
2) click on inspect a New chrome Windows will open with your application running in it.
I get this output/error when
cordova run android --target 0152a65c02a27d5b --verbose
Output
No scripts found for hook "before_run".
No scripts found for hook "before_prepare".
Checking config.xml for saved platforms that haven't been added to the project
Checking for any plugins added to the project that have not been installed in android platform
No differences found between plugins added to project and installed in android platform. Continuing...
Generating platform-specific config.xml from defaults for android at /Users/r00/Projects/myappGo/myapp_app/platforms/android/res/xml/config.xml
Merging project's config.xml into platform-specific android config.xml
Merging and updating files from [www, platforms/android/platform_www] to platforms/android/assets/www
Wrote out android application name "myapp" to /Users/r00/Projects/myappGo/myapp_app/platforms/android/res/values/strings.xml
Wrote out Android package name "com.myappgo.myapp" to /Users/r00/Projects/myappGo/myapp_app/platforms/android/src/com/myappgo/myapp/MainActivity.java
This app does not have launcher icons defined
This app does not have splash screens defined
Prepared android project successfully
No scripts found for hook "after_prepare".
Checking config.xml for saved plugins that haven't been added to the project
ANDROID_HOME=/Users/r00/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
Running command: /Users/r00/Projects/myappGo/myapp_app/platforms/android/gradlew cdvBuildDebug -b /Users/r00/Projects/myappGo/myapp_app/platforms/android/build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true
BUILD SUCCESSFUL
Total time: 1.695 secs
Command finished with error code 0: /Users/r00/Projects/myappGo/myapp_app/platforms/android/gradlew cdvBuildDebug,-b,/Users/r00/Projects/myappGo/myapp_app/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
Built the following apk(s):
/Users/r00/Projects/myappGo/myapp_app/platforms/android/build/outputs/apk/android-debug.apk
No scripts found for hook "before_deploy".
ANDROID_HOME=/Users/r00/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
Running command: adb devices
Command finished with error code 0: adb devices
Running command: adb devices
Command finished with error code 0: adb devices
Running adb shell command "cat /proc/cpuinfo" on target 0152a65c02a27d5b...
Running command: adb -s 0152a65c02a27d5b shell cat /proc/cpuinfo
Command finished with error code 0: adb -s,0152a65c02a27d5b,shell,cat,/proc/cpuinfo
Skipping build...
Built the following apk(s):
/Users/r00/Projects/myappGo/myapp_app/platforms/android/build/outputs/apk/android-debug.apk
Using apk: /Users/r00/Projects/myappGo/myapp_app/platforms/android/build/outputs/apk/android-debug.apk
Package name: com.myappgo.myapp
Installing apk /Users/r00/Projects/myappGo/myapp_app/platforms/android/build/outputs/apk/android-debug.apk on target 0152a65c02a27d5b...
Running command: adb -s 0152a65c02a27d5b install -r /Users/r00/Projects/myappGo/myapp_app/platforms/android/build/outputs/apk/android-debug.apk
Command finished with error code 255: adb -s,0152a65c02a27d5b,install,-r,/Users/r00/Projects/myappGo/myapp_app/platforms/android/build/outputs/apk/android-debug.apk
Error: adb: Command failed with exit code 255
at ChildProcess.whenDone (/Users/r00/Projects/myappGo/myapp_app/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:827:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:486:12)
I'm quiet lost here
My fix was to delete a few apps.
The phone gave a hint; it kept popping-up a message that storage was low. However, I didn't think this was related to not being able to install the app (initially).
Connection: MTP (Media Device)
USB debugging: On
Device: LG Risio
Android version: 6.0
Cordova CLI: 6.5.0
Framework: Ionic 1.x
Ionic CLI: 2.2.1
Machine: Mac OS X Sierra
Node: 4.4.2
Extra details:
I kept switching between MTP and PTP connection. Restarted the device. And, I kept plugging and unplugging the device from my computer. Nothing worked. The build is always successful in the console. But somehow, the app just wasn't getting installed on the device. I deleted the old version of the app sometimes that can cause a problem where there are inconsistent versions. But that didn't work either. When I deleted 3 big apps from the phone and tried installing again cordova run android, the app was finally installed on the phone.
From you command line run
adb -s 0152a65c02a27d5b shell cat /proc/cpuinfo
and check whether it fails and how.
As
Running command: adb devices
Command finished with error code 0: adb devices
may have succeeded perhaps you specific device is not detected or cannot obtain cpuinfo.
I can't figure out why I can no longer build Android apps using Cordova on the same computer that I used to build the same apps that worked last month, after having updated Cordova and NodeJS.
Currently I'm having to utilize super user privileges to get as far as Cordova launching the emulator, but it is then unable to install the app on the emulator and subsequently crashes with the following error.
So first to root with
sudo -E su
Then the cordova command will launch the emulator without sudo
cordova emulate android
if I try cordova run android, I get nothing launching on the connected device. The following is the output after dropping to root then running the emulate command.
Running command: /home/lyndon/myapp/platforms/android/cordova/run --emulator
ANDROID_HOME=/home/lyndon/Software/android-sdk-linux
JAVA_HOME=/usr/lib/jvm/java-8-oracle/bin
WARNING : no emulator specified, defaulting to myavd
Waiting for emulator...
emulator: emulator window was out of view and was recentered
Booting up emulator (this may take a while)...................BOOT COMPLETE
Running: /home/lyndon/myapp/platforms/android/gradlew cdvBuildDebug -b /home/lyndon/myapp/platforms/android/build.gradle -PcdvBuildArch=arm -Dorg.gradle.daemon=true
ERROR: JAVA_HOME is set to an invalid directory: /usr/lib/jvm/java-8-oracle/bin
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
/home/lyndon/myapp/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /home/lyndon/myapp/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/lyndon/myapp/platforms/android/build.gradle,-PcdvBuildArch=arm,-Dorg.gradle.daemon=true
Error: /home/lyndon/myapp/platforms/android/cordova/run: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
I never previously had to drop to root to launch the Android emulator with Cordova, why is this currently the case and why is the app not installing on the emulator?