kivy / python-for-android

Turn your Python application into an Android APK
https://python-for-android.readthedocs.io
MIT License
8.36k stars 1.86k forks source link

There is insufficient memory for the Java Runtime Environment to continue #1373

Closed thegameguy closed 6 years ago

thegameguy commented 6 years ago

Hi, I'm getting insufficient memory error while debugging.

log >

DEBUG: -> running ant debug DEBUG: Buildfile: /home/vapo/Gloworld/.buildozer/android/platform/build/dists/com.world.glowing/build.xml DEBUG:

DEBUG:

DEBUG:

DEBUG: [checkenv] Android SDK Tools Revision 25.2.5 DEBUG: [checkenv] Installed at /home/vapo/.buildozer/android/platform/android-sdk-20 DEBUG:

DEBUG: [echo] Project Name: Gloworld-0.1 DEBUG: [gettype] Project Type: Application DEBUG:

DEBUG:

DEBUG:

DEBUG:

DEBUG: [getbuildtools] Using latest Build Tools: 28.0.2 DEBUG: [echo] Resolving Build Target for Gloworld-0.1... DEBUG: [gettarget] Project Target: Android 4.4.2 DEBUG: [gettarget] API level: 19 DEBUG: [echo] ---------- DEBUG: [echo] Creating output directories if needed... DEBUG: [mkdir] Created dir: /home/vapo/Gloworld/.buildozer/android/platform/build/dists/com.world.glowing/bin/rsObj DEBUG: [mkdir] Created dir: /home/vapo/Gloworld/.buildozer/android/platform/build/dists/com.world.glowing/bin/rsLibs DEBUG: [echo] ---------- DEBUG: [echo] Resolving Dependencies for Gloworld-0.1... DEBUG: [dependency] Library dependencies: DEBUG: [dependency] No Libraries

DEBUG: [dependency] ------------------ DEBUG: [echo] ---------- DEBUG: [echo] Building Libraries with 'debug'... DEBUG: [subant] No sub-builds to iterate on DEBUG:

DEBUG: [mergemanifest] Found modified input file DEBUG: [mergemanifest] Merging AndroidManifest files into one. DEBUG: [mergemanifest] Manifest merger disabled. Using project manifest only. DEBUG: [echo] Handling aidl files... DEBUG: [aidl] No AIDL files to compile. DEBUG: [echo] ---------- DEBUG: [echo] Handling RenderScript files... DEBUG: [echo] ---------- DEBUG: [echo] Handling Resources... DEBUG: [aapt] Found modified input file DEBUG: [aapt] Generating resource IDs...

DEBUG: [echo] ---------- DEBUG: [echo] Handling BuildConfig class... DEBUG: [buildconfig] Generating BuildConfig class. DEBUG:

DEBUG:

DEBUG: [javac] Compiling 3 source files to /home/vapo/Gloworld/.buildozer/android/platform/build/dists/com.world.glowing/bin/classes DEBUG:

DEBUG:

DEBUG:

DEBUG: [dex] input: /home/vapo/Gloworld/.buildozer/android/platform/build/dists/com.world.glowing/bin/classes DEBUG: [dex] input: /home/vapo/Gloworld/.buildozer/android/platform/build/dists/com.world.glowing/libs/google-play-services.jar DEBUG: [dex] Pre-Dexing /home/vapo/Gloworld/.buildozer/android/platform/build/dists/com.world.glowing/libs/google-play-services.jar -> google-play-services-1014b8c3d64ef0a08ae7daf2986a299f.jar DEBUG: [dx] OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000e6bd2000, 194691072, 0) failed; error='Cannot allocate memory' (errno=12) DEBUG: [dx] # DEBUG: [dx] # There is insufficient memory for the Java Runtime Environment to continue. DEBUG: [dx] # Native memory allocation (mmap) failed to map 194691072 bytes for committing reserved memory. DEBUG: [dx] # An error report file with more information is saved as: DEBUG: [dx] # /home/vapo/Gloworld/.buildozer/android/platform/build/dists/com.world.glowing/hs_err_pid2532.log DEBUG:
DEBUG: BUILD FAILED DEBUG: /home/vapo/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:888: The following error occurred while executing this line: DEBUG: /home/vapo/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:890: The following error occurred while executing this line: DEBUG: /home/vapo/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:902: The following error occurred while executing this line: DEBUG: /home/vapo/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:283: null returned: 1 DEBUG:
DEBUG: Total time: 1 minute 1 second Exception in thread background thread for pid 2509: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 754, in run self.target(*self.args, **self.__kwargs) File "/home/vapo/.local/lib/python2.7/site-packages/sh.py", line 2170, in background_thread handle_exit_code(exit_code) File "/home/vapo/.local/lib/python2.7/site-packages/sh.py", line 1929, in fn return self.command.handle_command_exit_code(exit_code) File "/home/vapo/.local/lib/python2.7/site-packages/sh.py", line 672, in handle_command_exit_code raise exc ErrorReturnCode_1:

RAN: /home/vapo/.buildozer/android/platform/apache-ant-1.9.4/bin/ant debug

STDOUT: Buildfile: /home/vapo/Gloworld/.buildozer/android/platform/build/dists/com.world.glowing/build.xml

-set-mode-check:

-set-debug-files:

-check-env: [checkenv] Android SDK Tools Revision 25.2.5 [checkenv] Installed at /home/vapo/.buildozer/android/platform/android-sdk-20

-setup: [echo] Project Name: Gloworld-0.1 [gettype] Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup: [getbuildtools] Using latest Build Tools: 28.0.2 [echo] Resolving Build Target for Gloworld-0.1... [gettarget] Project Target: Android 4.4.2 [gettarget] API level: 19 [echo] ---------- [echo] Creating output directories if needed... [mkdir] Created dir: /home/vapo/Gloworld/.buildozer/android/platform/build/dists/com.world.glowing/bin/rsObj [mkdir] Created dir: /home/vapo/Gloworld/.buildozer/android/platform/build/dists/com.world.glowing/bin/rsLibs [echo] ---------- [echo] Resolving Dependencies for Gloworld-0.1... [dependency] Library dependencies: [dependency] No Libraries [dependency] [dependency] ------------------ [echo] ---------- [echo] Building Libraries with 'debug'... [subant] No sub-builds to iterate on

-code-gen: [mergemanifest] Found modified input file [mergemanifest] Merging AndroidManifest files into one. [mergemanifest] Manifest merger disabled. Using project manifest only. [echo] Handling aidl files... [aidl] No AIDL files to compile. [echo] ---------- [echo] Handling RenderScript files... [echo] ---------- [echo] Handling Resources... [aapt] Found modified input file [aapt] Generating resource IDs... [aapt] (skipping file '.gitkeep' due to ANDROID_AAPT_IGNORE pattern '.*') [echo] ---------- [echo] Handling BuildConfig class... [buildconfig] Generating BuildConfig class.

-pre-compile:

-compile: [javac] Compiling 3 source files to /home/vapo/Gloworld/.buildozer/android/platform/build/dists/com.world.glowing/bin/classes

-post-compile:

-obfuscate:

-dex: [dex] input: /home/vapo/Gloworld/.buildozer/android/platform/build/dists/com.world.glowing/bin/classes [dex] input: /home/vapo/Gloworld/.buildozer/android/platform/build/dists/com.world.glowing/libs/google-play-services.jar [dex] Pre-Dexing /home/vapo/Gloworld/.buildozer/android/platform/build/dists/com.world.glowing/libs/google-play-services.jar -> google-play-services-1014b8c3d64ef0a08ae7daf2986a299f.jar [dx] OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000e6bd2000, 194691072, 0) failed; error='Cannot allocate memory' (errno=12) [dx] # [dx] # There is insufficient memory for the Java Runtime Environment to continue. [dx] # Native memory allocation (mmap) failed to map 194691072 bytes for committing reserved memory. [dx] # An error report file with more information is saved as: [dx] # /home/vapo/Gloworld/.buildozer/android/platform/build/dists/com.world.glowing/hs_err_pid2532.log

BUILD FAILED /home/vapo/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:888: The following error occurred while executing this line: /home/vapo/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:890: The following error occurred while executing this line: /home/vapo/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:902: The following error occurred while executing this line: /home/vapo/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:283: null returned: 1

Total time: 1 minute 1 second

STDERR:

INFO: STDOUT (last 20 lines of 83): -obfuscate:

-dex:
[dex] input: /home/vapo/Gloworld/.buildozer/android/platform/build/dists/com.world.glowing/bin/classes
[dex] input: /home/vapo/Gloworld/.buildozer/android/platform/build/dists/com.world.glowing/libs/google-play-services.jar [dex] Pre-Dexing /home/vapo/Gloworld/.buildozer/android/platform/build/dists/com.world.glowing/libs/google-play-services.jar -> google-play-services-1014b8c3d64ef0a08ae7daf2986a299f.jar [dx] OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000e6bd2000, 194691072, 0) failed; error='Cannot allocate memory' (errno=12)
[dx] #
[dx] # There is insufficient memory for the Java Runtime Environment to continue.
[dx] # Native memory allocation (mmap) failed to map 194691072 bytes for committing reserved memory. [dx] # An error report file with more information is saved as:
[dx] # /home/vapo/Gloworld/.buildozer/android/platform/build/dists/com.world.glowing/hs_err_pid2532.log

BUILD FAILED
/home/vapo/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:888: The following error occurred while executing this line: /home/vapo/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:890: The following error occurred while executing this line: /home/vapo/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:902: The following error occurred while executing this line: /home/vapo/.buildozer/android/platform/android-sdk-20/tools/ant/build.xml:283: null returned: 1

Total time: 1 minute 1 second

cd /home/vapo/Gloworld/.buildozer/android/platform/build/dists/com.world.glowing && /home/vapo/.buildozer/android/platform/apache-ant-1.9.4/bin/ant debug

[WARNING]: ERROR: /home/vapo/.buildozer/android/platform/apache-ant-1.9.4/bin/ant failed!

Command failed: /usr/bin/python -m pythonforandroid.toolchain apk --debug --bootstrap=sdl2-admob --dist_name com.world.glowing --name Gloworld --version 0.1 --package com.world.glow.com.world.glowing --android_api 19 --minsdk 9 --private /home/vapo/Gloworld/.buildozer/android/app --permission INTERNET --permission ACCESS_WIFI_STATE --permission ACCESS_NETWORK_STATE --permission VIBRATE --presplash /home/vapo/Gloworld/./pre.png --icon /home/vapo/Gloworld/./appicon.png --orientation landscape --copy-libs --arch armeabi-v7a --color=always --storage-dir=/home/vapo/Gloworld/.buildozer/android/platform/build

#

Buildozer failed to execute the last command

The error might be hidden in the log above this error

Please read the full log, and search for it before

raising an issue with buildozer itself.

In case of a bug report, please add a full log with log_level = 2

thegameguy commented 6 years ago

This means that low ram, Increasing ram solves the issue.