Closed molbertz closed 2 years ago
Can you try the following:
run: mvn -Pandroid gluonfx:build gluonfx:package
cd target/gluonfx/aarch64-android/gvm/android_project/
edit the file app/build.gradle
and add:
android {
...
defaultConfig {
minSdkVersion 21
targetSdkVersion 30
ndk {
ldLibs "log"
}
}
...
}
and save the file.
export ANDROID_SDK_ROOT=~/.gluon/substrate/Android
./gradlew app:assembleDebug
cd ../../../../../
mvn -Pandroid gluonfx:install gluonfx:nativerun
And see if it works now?
I did and the build seemed successful. But I can't find the newly built apk. This one: "target/gluonfx/aarch64-android/gvm/GoNative.apk" has the same checksum as the original build. And so does this one: "target/gluonfx/aarch64-android/gvm/android_project/app/build/outputs/apk/debug/app-debug.apk"
I need the actual apk because I need to send it to our testers. The mvn -Pandroid gluonfx:install gluonfx:nativerun
call runs just fine with the phone connected to my pc. But that one runs a lower Android version and had no problems with the original build.
I've build the sample multiple times. I tried Java 11 Gluon GraalVM 22.0.0.2 and Java 17 Gluon GraalVM 22.0.0.3. Both of those run on Android 10 and older. On newer Android versions the app crashes with the same error each time:
2022-04-13 10:22:45.598 28622-28622/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.bscgmbh, PID: 28622 java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__android_log_print" referenced by "/data/app/~~vrzTQ9N_jgWhG_fx0Iux0Q==/com.bscgmbh-FVgmytBzS5bwQzbKH3Ud5w==/lib/arm64/libsubstrate.so"... at java.lang.Runtime.loadLibrary0(Runtime.java:1087) at java.lang.Runtime.loadLibrary0(Runtime.java:1008) at java.lang.System.loadLibrary(System.java:1664) at com.gluonhq.helloandroid.MainActivity.surfaceCreated(MainActivity.java:111)