error when ionic cordova run android in ionic - android

error in my terminal
Android Studio project detected
ANDROID_HOME=C:\Users\FUJIN\AppData\Local\Android\Sdk\tools
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_161\
studio
Subproject Path: CordovaLib
Subproject Path: app
FAILURE: Build failed with an exception.
Where:
Script 'C:\Users\FUJIN\hilih\platforms\android\CordovaLib\cordova.gradle' line: 68
What went wrong:
A problem occurred evaluating project ':CordovaLib'.
No installed build tools found. Install the Android build tools version 19.1.0 or higher.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 0s
(node:15572) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
Where:
Script 'C:\Users\FUJIN\hilih\platforms\android\CordovaLib\cordova.gradle' line: 68
What went wrong:
A problem occurred evaluating project ':CordovaLib'.
No installed build tools found. Install the Android build tools version 19.1.0 or higher.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 0s
at ChildProcess.whenDone (C:\Users\FUJIN\hilih\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
at ChildProcess.emit (events.js:180:13)
at maybeClose (internal/child_process.js:936:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5) (node:15572)
UnhandledPromiseRejectionWarning: Unhandled promise rejection. This
error originated either by throwing inside of an async function
without a catch block, or by rejecting a promise which was not handled
with .catch(). (rejection id: 1) (node:15572) [DEP0018]
DeprecationWarning: Unhandled promise rejections are deprecated. In
the future, promise rejections that are not handled will terminate the
Node.js process with a non-zero exit code. [02:00:48] lint finished
in 4.01 s
[OK] Your app has been deployed.
Did you know you can live-reload changes from your app with --livereload?

Related

IONIC apk Generate Issue

I have getting this error when I run ionic cordova build --release android
but yesterday it was running perfectly im not change anything about configuration only build distribution I think it is version issue but I unable to find how to resolve it please help
here is console log
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':app:releaseCompileClasspath'.
> Could not find any version that matches com.google.firebase:firebase-measurement-connector:[10.2.1,12.1.0[.
Versions that do not match:
17.0.0
16.0.0
15.0.0
Required by:
project :app > com.google.firebase:firebase-messaging:17.0.0
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or
--debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED
in 41s
11 actionable tasks: 11 executed
(node:15826) UnhandledPromiseRejectionWarning: Error: /home/chamikara/Projects/freelance/ionic/beachlines/notifications/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':app:releaseCompileClasspath'.
> Could not find any version that matches com.google.firebase:firebase-measurement-connector:[10.2.1,12.1.0[.
Versions that do not match:
17.0.0
16.0.0
15.0.0
Required by:
project :app > com.google.firebase:firebase-messaging:17.0.0
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 41s
at ChildProcess.whenDone (/home/chamikara/Projects/freelance/ionic/beachlines/notifications/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
(node:15826) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:15826) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Related to this answer : https://stackoverflow.com/a/51779975/279326 I fixed by going back to ionic#4.0.3 npm i -g ionic#4.0.3

Ionic Fails To build and deploy apk to physical device

I'm trying to build an app that I have tested on other devices and computers using ionic 2. I keep getting this error followed by build completed and app deployed even though it is not.
(node:11125) UnhandledPromiseRejectionWarning: Error: /Users/kieran/Desktop/finalyearproject/frontendrest/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugAssets'.
> java.io.IOException: Could not delete path '/Users/kieran/Desktop/finalyearproject/frontendrest/platforms/android/app/build/intermediates/assets/debug/www/index.html'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
at ChildProcess.whenDone (/Users/kieran/Desktop/finalyearproject/frontendrest/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
(node:11125) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:11125) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[OK] Your app has been deployed.
Did you know you can live-reload changes from your app with --livereload?
MacOSs-MacBook-Pro:frontendrest kieran$
Sometimes I have similar problems.
Just delete intermediates folder in your path:
/Users/kieran/Desktop/finalyearproject/frontendrest/platforms/android/app/build/intermediates
Kill 'java' process in your task manager.

Gradle error while Cordova build

After closing Intel XDK I started seek for another tool to convert my html5/phaser game to android. So, I watched some videos on YouTube and decide to try using Cordova and Node.js command line.
I downloaded and installed Android Studio, Node.js and JDK (8u162 version, because it is the last version for Windows 32-bit, as I see).
After installing cordova with node.js command line and creating a new project I tried to build my project and I have next error:
D:\Android\Development\datesniper>cordova prepare
Android Studio project detected
D:\Android\Development\datesniper>cordova build android --debug
Android Studio project detected
ANDROID_HOME=C:\Users\Aleksey\AppData\Local\Android\sdk
JAVA_HOME=D:\Java\jdk-8u162
studio
Subproject Path: CordovaLib
Subproject Path: app
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/
4.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
* Get more help at https://help.gradle.org
(node:4316) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with ex
it code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/
4.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
* Get more help at https://help.gradle.org
at ChildProcess.whenDone (D:\Android\Development\datesniper\platforms\androi
d\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
(node:4316) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This
error originated either by throwing inside of an async function without a catch
block, or by rejecting a promise which was not handled with .catch(). (rejection
id: 1)
(node:4316) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre
cated. In the future, promise rejections that are not handled will terminate the
Node.js process with a non-zero exit code.
D:\Android\Development\datesniper>
What can I do? Is there some other (less complicated) way to convert my phaser game to android?
Thanks!
Update: when I try to create new project in Android Studio, there is a mistake while building:
Gradle sync failed: CreateProcess error=216, Version "%1" is not compatible with the version of Windows running on this computer.
How can I replace gradle version for 32-bit Windows?

How to build android version 6.4.0 with crosswalk plugin?

I trying to build android version 6.4.0 after install crosswalk plugin version 2.4.0.
First I removed the android platform and I reinstalled it using the following commands:
ionic cordova platform rm android
ionic cordova platform add android#6.4.0
The installation is succeeded.
Moreover, I installed the crosswalk plugin using the following command line:
ionic cordova plugin add cordova-plugin-crosswalk-webview
Also the installation is succeeded
Now I need to build the ionic2 application!
ionic cordova build android
But the building is failed I got the following errors:
> cordova build android
ANDROID_HOME=/Users/Khaled/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home
Subproject Path: CordovaLib
Configuration 'compile' in project ':' is deprecated. Use 'implementation' instead.
null
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_cobuqw2y8dlztu9fe2xpnvg13.run(/Users/Khaled/iCloud Drive (Archive)/Documents/Projects/ionic/rnb/rnb-receiver/platforms/android/build.gradle:143)
org.xwalk:xwalk_core_library:23+
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
>
All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com/r/tools/flavorDimensions-missing-error-message.html
* Try:
Run with --stacktrace
option to get the stack trace. Run with --info or
--debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED
in 1s
(node:21899) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: /Users/Khaled/iCloud Drive (Archive)/Documents/Projects/ionic/rnb/rnb-receiver/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com/r/tools/flavorDimensions-missing-error-message.html
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
(node:21899) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
cordova version 8.0.0
What is the reason for this error occurrence. and what is the solution?
Thanks.

Unable to build android app with phonegap/cordova

I am trying to build an android app with phonegap/cordova but it's failing. Below is the command
cordova build android
This is the result:
Android Studio project detected
ANDROID_HOME=/home/harish/Android/Sdk
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
studio
FAILURE: Build failed with an exception.
What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 0s
(node:26252) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: /usr/lib/gradle/4.4.1/bin/gradle: Command failed with exit code 1
(node:26252) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Categories

Resources