Gradle build error while importing android studio project - android

Whenever I try to open any downloaded project in android studio it always gives me error given below
Error: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/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
15:10:36.821 [main] DEBUG o.g.l.daemon.bootstrap.DaemonMain - Assuming the daemon was started with following jvm opts: [-XX:MaxPermSize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Xmx1024m, -Dfile.encoding=windows-1252, -Duser.country=US, -Duser.language=en, -Duser.variant]
FAILURE: Build failed with an exception.
* What went wrong:
Could not create service of type DaemonContext using DaemonServices.createDaemonContext().
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
I have tried many setting changes but nothing helped please someone suggest me the solution

Related

Android Studio (flutter): Unable to start the daemon process

I just downloaded android studio, and when I tried to run a flutter project, I got this on the console:
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
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 Manual chapter on the daemon at https://docs.gradle.org/6.7/userguide/gradle_daemon.html
Process command line: C:\Program Files (x86)\Java\jre1.8.0_301\bin\java.exe -Xmx1536M -Dfile.encoding=windows-1252 -Duser.country=BR -Duser.language=pt -Duser.variant -cp C:\Users\pedro.gradle\wrapper\dists\gradle-6.7-all\cuy9mc7upwgwgeb72wkcrupxe\gradle-6.7\lib\gradle-launcher-6.7.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 6.7
Please read the following process output to find out more:
Error occurred during initialization of VM
Could not reserve enough space for 1572864KB object heap
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
Exception: Gradle task assembleDebug failed with exit code 1
I tried to delete my ".gradle" file as was recommended in a similar question, but a new ".gradle" file is created in the same folder whenever I try to run the project.

Can't build APK using Qt Creator due to gradle error

I am trying to build a project for Android on MacOS with Qt Creator 4.14, Qt 5.15.2, NDK 3.0, SDK 21.3.6528147. Qt shows green checkmarks for Java/Android/OpenSSL
When I compile my app I see these errors during the "Generating Android Package" step (I think that's gradle called by qtdeployandroid):
Initialized native services in: /Users/admin/.gradle/native
The client will now receive all logging from the daemon (pid: 1778). The daemon log file: /Users/admin/.gradle/daemon/5.6.4/daemon-1778.out.log
Starting 9th build in daemon [uptime: 53 mins 14.777 secs, performance: 99%]
Using 2 worker leases.
FAILURE: Build failed with an exception.
* What went wrong:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
> Could not create service of type FileHasher using BuildSessionScopeServices.createFileSnapshotter().
* Try:
Run with --stacktrace option to get the stack trace. Run with --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 971ms
Building the android package failed!
20:04:18: The process "/Users/admin/Qt/5.15.2/android/bin/androiddeployqt" exited with code 14.
Error while building/deploying project BFChristmasParty (kit: Android Qt 5.15.2 Clang Multi-Abi)
When executing step "Build Android APK"
20:04:18: Elapsed time: 01:42.
My project resides on a SMB share in case that matters.
Check permissions of /Users/admin/.gradle/native... and you can navigate to the directory and then run ./gradlew assembleDebug --stacktrace (it may also be gradle or assemble, depending how it is set up).

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?

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