Skip to content

plugins and android apk build bug #206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sb-codz opened this issue Mar 30, 2025 · 2 comments
Open

plugins and android apk build bug #206

sb-codz opened this issue Mar 30, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@sb-codz
Copy link

sb-codz commented Mar 30, 2025

Log output:

root@vcspace .../AppProjects/ShowcasePlugin # bash build.sh
Found ANDROID_HOME at /home/android-sdk
ANDROID_HOME set to /home/android-sdk and saved to profile
ANDROID_HOME is set to /home/android-sdk
Running Gradle assembleRelease...
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.For more details on the daemon, please refer to https://docs.gradle.org/8.11.1/userguide/gradle_daemon.html in the Gradle documentation.
Process command line: /usr/lib/jvm/java-17-openjdk/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp /root/.gradle/wrapper/dists/gradle-8.11.1-bin/bpt9gzteqjrbo1mjrsomdt32c/gradle-8.11.1/lib/gradle-daemon-main-8.11.1.jar -javaagent:/root/.gradle/wrapper/dists/gradle-8.11.1-bin/bpt9gzteqjrbo1mjrsomdt32c/gradle-8.11.1/lib/agents/gradle-instrumentation-agent-8.11.1.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.11.1
Please read the following process output to find out more:
-----------------------
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000000000002b0f0, pid=2523, tid=2524
#
# JRE version: OpenJDK Runtime Environment (17.0.14+7) (build 17.0.14+7-alpine-r0)
# Java VM: OpenJDK 64-Bit Server VM (17.0.14+7-alpine-r0, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
# Problematic frame:
# C  [libnative-platform-file-events.so+0x2eaac]  _init+0x39d4
#
# Core dump will be written. Default location: core.2523 (may not exist)
#
# An error report file with more information is saved as:
# /root/.gradle/daemon/8.11.1/hs_err_pid2523.log
#
# If you would like to submit a bug report, please visit:
#   https://gitlab.alpinelinux.org/alpine/aports/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#


* 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.
root@vcspace .../AppProjects/ShowcasePlugin # ```
@sb-codz sb-codz added the bug Something isn't working label Mar 30, 2025
@itsvks19
Copy link
Member

It looks like Gradle's daemon is crashing due to a SIGSEGV (segmentation fault) in libnative-platform-file-events.so. Since you're using Alpine Linux, this could be due to compatibility issues between Alpine's musl libc and some Java native libraries.

Possible Fixes:

1. Use a Different JDK (Try OpenJDK 21 or Temurin JDK)

Alpine's OpenJDK builds sometimes have issues with Gradle. Try using a different JDK:

Option 1: Install OpenJDK 21

apk add openjdk21-jdk
export JAVA_HOME=/usr/lib/jvm/java-21-openjdk
export PATH=$JAVA_HOME/bin:$PATH

Then, retry:

gradle --stop
gradle clean assembleRelease

Option 2: Use Temurin JDK (Recommended)

Temurin JDK (by Adoptium) is more stable for Gradle. Download it manually:

wget https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.10+7/OpenJDK17U-jdk_x64_linux_hotspot_17.0.10_7.tar.gz
tar -xzf OpenJDK17U-jdk_x64_linux_hotspot_17.0.10_7.tar.gz
mv jdk-17.0.10+7 /opt/temurin17
export JAVA_HOME=/opt/temurin17
export PATH=$JAVA_HOME/bin:$PATH

Then, retry the build.


2. Disable Gradle Daemon

Since the crash happens in the daemon, try running Gradle without it:

export GRADLE_OPTS="-Dorg.gradle.daemon=false"
gradle clean assembleRelease

3. Use glibc-based Alpine

If nothing else works, try using glibc instead of musl:

apk add gcompat

I'll suggest you to use termux for building plugins.
Let me know what works for you!

@sb-codz
Copy link
Author

sb-codz commented Apr 3, 2025

update build.sh
problem in termux.

Termux environment detected
Found Android SDK in Termux at /data/data/com.termux/files/usr/share/android-sdk
ANDROID_HOME set to /data/data/com.termux/files/usr/share/android-sdk and saved to Termux profile
ANDROID_HOME is set to /data/data/com.termux/files/usr/share/android-sdk
Running Gradle assembleRelease...
Detected Termux, applying AAPT2 fixes...```

solution 
```mkdir -p .gradle
export GRADLE_USER_HOME="$HOME/.gradle"```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
@sb-codz @itsvks19 and others