PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 2024 → Gradle daemon needs larger heap size
Gradle daemon needs larger heap size
Débuté par Niels, 20 juin 2017 10:26 - 8 réponses
Posté le 20 juin 2017 - 10:26
Bonjour,

j'essaie de compiler mon project mais ca affiche cet erreur.


Erreur retournée :


Running dex as a separate process.

To run dex in process, the Gradle daemon needs a larger heap.
It currently has 1024 MB.
For faster builds, increase the maximum heap size for the Gradle daemon to at least 1536 MB (based on the dexOptions.javaMaxHeapSize = 1024m).
To do this set org.gradle.jvmargs=-Xmx1536M in the project gradle.properties.
For more information see https://docs.gradle.org/current/userguide/build_environment.html

Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/feitianBLE/reader/devicecontrol/Atr_t;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/feitianBLE/reader/devicecontrol/Atr_t$_ib;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/feitianBLE/reader/devicecontrol/BleCard;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/feitianBLE/reader/devicecontrol/CardCmd;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/feitianBLE/reader/devicecontrol/Catr;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/feitianBLE/reader/protocol/IProto;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/feitianBLE/reader/protocol/I_Packed;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/feitianBLE/reader/protocol/ProtocolExtended;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/feitianBLE/reader/protocol/ProtocolT0;
Dex: Error converting bytecode to dex:
Cause: java.lang.RuntimeException: Translation has been interrupted
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:613)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
Caused by: java.lang.InterruptedException: Too many errors
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:605)
... 4 more

:transformClassesWithDexForDebug FAILED


J'ai cherché sur google et j'ai essaié de changer mon build.gradle file pour ca mais le valeur originale retourne quand je compile mon projet.

Cordialement,

Niels
Posté le 20 juin 2017 - 13:04
Hi. You don't need change the project options to configure Gradle behaviour. You can create a gradle.properties file in <folder windows user>\.gradle folder

The file content can be for example:

# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Settings specified in this file will override any Gradle settings
# configured through the IDE.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# The Gradle daemon aims to improve the startup and execution time of Gradle.
# When set to true the Gradle daemon is to run the build.
# TODO: disable daemon on CI, since builds should be clean and reliable on servers
org.gradle.daemon=true

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
org.gradle.jvmargs=-Xms1g -Xmx6g -XX:MaxPermSize=1g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html…
org.gradle.parallel=true

# Enables new incubating mode that makes Gradle selective when configuring projects.
# Only relevant projects are configured which results in faster builds for large multi-projects.
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html…
#org.gradle.configureondemand=false

org.gradle.java.home=D:\\Program Files\\Java\\jdk1.8.0_131

org.gradle.workers.max=16

com.android.build.gradle.overridePathCheck=true

com.android.build.gradle.overrideVersionCheck=true

#startParameter.offline=false


You must change the java folder and your memory and CPU cores/threads usage by Gradle. More memory then more speed.


Rubén
Posté le 03 juillet 2017 - 12:22
Bonjour,
J'ai exactement le même message, dans mon projet ce matin , en ajoutant une fenêtre avec un champ carte.
Avez-vous trouvé la solution. Merci d'avance.
Membre enregistré
151 messages
Popularité : +7 (7 votes)
Posté le 06 juillet 2017 - 13:14
Même problème en ajoutant des dépendances Maven, je suis coincé et espère une solution.

Meilleures salutations.
Posté le 03 octobre 2017 - 10:11
Bonjour,

J'ai également ce problème. J'ai ess ayé de recréer le fichier comme indiqué mais rien n'y fait. Avez vous trouvé une solution?

PCsoft en pense quoi ?

Laurent
Membre enregistré
51 messages
Popularité : +1 (1 vote)
Posté le 18 juillet 2018 - 10:54
Idem pour moi.
Avez vous réussi à résoudre le problème ?
Membre enregistré
106 messages
Popularité : +3 (3 votes)
Posté le 23 juillet 2018 - 17:29
Bonsoir,

moi aussi j'ai ce soucis depuis mercredi 18/07/18 ...
et quand je générè mon apk depuis le poste d'un collègue, pas de soucis..

Une idée svp ?

--
- ian -
Membre enregistré
794 messages
Popularité : +40 (42 votes)
Posté le 23 juillet 2018 - 18:46
Salut. Il suffit d'utiliser les fichiers texte gradle.properties que j'ai indiqué ci-dessus. Vous devrez configurer la ligne JDK en fonction de votre version et de la quantité de mémoire en fonction des possibilités de votre PC. Dans mon cas, c'est 16 Go. La ligne importante est celle qui commence par "org.gradle.jvmargs".

Ma configuration actuelle pour WM23 est :

# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Settings specified in this file will override any Gradle settings
# configured through the IDE.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# The Gradle daemon aims to improve the startup and execution time of Gradle.
# When set to true the Gradle daemon is to run the build.
# TODO: disable daemon on CI, since builds should be clean and reliable on servers
org.gradle.daemon=true
org.gradle.daemon.idletimeout=3600000

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
org.gradle.jvmargs=-Xms1g -Xmx8g -XX:MaxPermSize=1g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html…
org.gradle.parallel=false

# Enables new incubating mode that makes Gradle selective when configuring projects.
# Only relevant projects are configured which results in faster builds for large multi-projects.
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html…
org.gradle.configureondemand=false

org.gradle.java.home=C:\\Program Files\\Java\\jdk1.8.0_172

#org.gradle.workers.max=6

com.android.build.gradle.overridePathCheck=true

com.android.build.gradle.overrideVersionCheck=true

org.gradle.caching=true

#startParameter.offline=false
Membre enregistré
51 messages
Popularité : +1 (1 vote)
Posté le 24 juillet 2018 - 10:41
Dans mon cas, le fichier gradle.properties se met à jour automatiquement lors de la compilation et les lignes que j'ajoute se suppriment elles-mêmes.
Je penses que mon souci vient du peu de RAM présente sur mon poste (4go).
Merci tout de même pour votre partage :merci:
Message modifié, 24 juillet 2018 - 10:42