Gradle error while Cordova build - android

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?

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

error when ionic cordova run android in ionic

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?

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.

Cant build ionic app in ionic version 2.2.3

Im new to Ionic 2 and I cant build my app, Im using Ionic Version 2.2.3. I already tried different solutions like adding some Environmental Variables but I still cant build. Hope you can help me, thanks in advance. Here is the error in cmd:
ANDROID_HOME=C:\Users\Administrator\AppData\Local\Android\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131`enter code here`
Subproject Path: CordovaLib
Starting a new Gradle Daemon for this build (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/
2.14.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.

Gradle error - ionic build android

I am try to compile an new project using command ionic build android, but i get this error:
C:\Users\pedromiguel\aplicacionesIonic\sqliteTest>ionic build android
Running command: "C:\Program Files\nodejs\node.exe" C:\Users\pedromiguel\aplicacionesIonic\sqliteTest\hooks\after_prepare\010_add_platform_class.js C:\Users\pedromiguel\aplicacionesIonic\sqliteTest
add to body class: platform-android
ANDROID_HOME=C:\Users\pedromiguel\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_101
Subproject Path: CordovaLib
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 http://gradle.org/docs/2.2.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.
Error: cmd: Command failed with exit 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 http://gradle.org/docs/2.2.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.
System info
C:\Users\pedromiguel\aplicacionesIonic\sqliteTest>ionic info
Your system information:
ordova CLI: 6.4.0
Ionic CLI Version: 2.1.17
Ionic App Lib Version: 2.1.7
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v5.5.0
Xcode version: Not installed
I tried multiples solution's, i find it these the follow question:
Link 1
Your path should be wrong .Check your java setup first. Refer following link https://forum.ionicframework.com/t/unable-to-start-the-daemon-process/34301/5
If it will not work then change gradle.property by
Open Android Studio then go to gradle.properties file and change the last line to
org.gradle.jvmargs=-Xmx1024m.
And then press try again . Refer Android Studio Gradle project "Unable to start the daemon process /initialization of VM"
I fixed this problem by replacing complete Gradle file with original gradle file.It worked for me.

Categories

Resources