Skip to content
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

No implementation found for void org.love2d.android.GameActivity.nativeSetDefaultStreamValues(int, int) #208

Closed
castelo3442 opened this issue Aug 8, 2021 · 7 comments

Comments

@castelo3442
Copy link

Hi. After Installing love-android and Android studio (4.2.2) in a new computer*, and following this git hub documentation to configure it, my game crashes at the beginning of the debugging process. I get this error in the logcat:
(...)
2021-08-08 03:26:29.758 7795-7795/org.love2d.android.embed E/d.android.embe: No implementation found for void org.love2d.android.GameActivity.nativeSetDefaultStreamValues(int, int) (tried Java_org_love2d_android_GameActivity_nativeSetDefaultStreamValues and Java_org_love2d_android_GameActivity_nativeSetDefaultStreamValues__II)
2021-08-08 03:26:29.881 7795-7795/org.love2d.android.embed E/AndroidRuntime: FATAL EXCEPTION: SDLActivity
Process: org.love2d.android.embed, PID: 7795
java.lang.UnsatisfiedLinkError: No implementation found for void org.love2d.android.GameActivity.nativeSetDefaultStreamValues(int, int) (tried Java_org_love2d_android_GameActivity_nativeSetDefaultStreamValues and Java_org_love2d_android_GameActivity_nativeSetDefaultStreamValues__II)
at org.love2d.android.GameActivity.nativeSetDefaultStreamValues(Native Method)
at org.love2d.android.GameActivity.onCreate(GameActivity.java:125)
at android.app.Activity.performCreate(Activity.java:8000)
at android.app.Activity.performCreate(Activity.java:7984)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

This is when it happens in the debug (app/console):
(...)
Now Launching Native Debug Session
$ adb shell cat /data/local/tmp/lldb-server | run-as org.love2d.android.embed sh -c 'cat > /data/data/org.love2d.android.embed/lldb/bin/lldb-server && chmod 700 /data/data/org.love2d.android.embed/lldb/bin/lldb-server'
$ adb shell cat /data/local/tmp/start_lldb_server.sh | run-as org.love2d.android.embed sh -c 'cat > /data/data/org.love2d.android.embed/lldb/bin/start_lldb_server.sh && chmod 700 /data/data/org.love2d.android.embed/lldb/bin/start_lldb_server.sh'
Starting LLDB server: /data/data/org.love2d.android.embed/lldb/bin/start_lldb_server.sh /data/data/org.love2d.android.embed/lldb unix-abstract /org.love2d.android.embed-0 platform-1628403951015.sock "lldb process:gdb-remote packets"
Debugger attached to process 7795

Process finished with exit code 9

Not sure if its related, but in the Build, I get this massages (there are a few more "NO-SOURCE" before):
(...)

Task :app:processEmbedDebugJavaRes NO-SOURCE
Task :love:processEmbedDebugJavaRes NO-SOURCE
Task :love:bundleLibResEmbedDebug NO-SOURCE
Task :app:mergeEmbedDebugJavaResource UP-TO-DATE
Task :app:mergeEmbedDebugJniLibFolders UP-TO-DATE
Task :love:generateJsonModelEmbedDebug

Task :love:externalNativeBuildEmbedDebug
Build multiple targets hidapi_armeabi-v7a openal_armeabi-v7a mpg123_armeabi-v7a love_armeabi-v7a
Android NDK: WARNING:C:/love-android/love/src/jni/oboe/Android.mk:oboe: LOCAL_LDLIBS is always ignored for static libraries
make: Nothing to be done for 'mpg123'.
make: Nothing to be done for 'openal'.

Task :love:mergeEmbedDebugJniLibFolders UP-TO-DATE
Task :love:mergeEmbedDebugNativeLibs UP-TO-DATE
Task :love:stripEmbedDebugDebugSymbols UP-TO-DATE
Task :love:copyEmbedDebugJniLibsProjectOnly UP-TO-DATE
Task :app:mergeEmbedDebugNativeLibs UP-TO-DATE
Task :app:stripEmbedDebugDebugSymbols UP-TO-DATE
Task :app:validateSigningEmbedDebug UP-TO-DATE

Task :app:packageEmbedDebug
There are no .so files available to package in the APK for x86.

*P.S: I`ve tried it in a new computer because the old one started to present the same error after the installation of updates for Android Studio and plug-ins. Trying to solve it is what led to the "libc++shared.so" error. I fixed this one, but the crashes kept happening. The game was being compiled and debugging normally before those crashes started.

@MikuAuahDark
Copy link
Collaborator

That's odd. The recent GitHub Actions CI compiles the APK successfully and I double-checked the APK contents that native libraries for armeabi-v7a and arm64-v8a are present, just like how I build it locally.

Recently I also start seeing people have this problem. Could it be because they're not using Java 8? Please confirm the Java version you're using and love-android branch you checked out.

@castelo3442
Copy link
Author

castelo3442 commented Aug 8, 2021

jre1.8.0_301
Master branch (git clone --recurse-submodules https://github.com/love2d/love-android)
The gradle build finishes with success.

@castelo3442
Copy link
Author

The debug .apk finally worked on the real phone again!!! : ) But I cannot try the .aab bundle on it :( (and I will need it a lot, since my next step seems to be the most difficult of all: configuring in-app billing).

Since the game worked on the cell phone, one possibility is that the problem is related to the debug action on android studio. It crashes always on this line:
Starting LLDB server: /data/data/org.love2d.android.embed/lldb/bin/start_lldb_server.sh /data/data/org.love2d.android.embed/lldb unix-abstract /org.love2d.android.embed-0 platform-1628403951015.sock "lldb process:gdb-remote packets"

After a few changes in configurations and updates, the app stopped crashing. Instead, it didnt finish to load at all, getting stuck in this same line. In one of the attempts , it was possible to see that it was trying to load libc++_shared.so forever (so it was not only a bug in my attempts yesterday). In other attempts, it froze at libartbase.so, for instance. Im not sure how it works exactly, but it seems strange that when gradle is compiling (in powershell) it loads the other array elements with armeabi-v7a, but not libc++_shared.so. Anyways, when you asked me yesterday to inspect the lib/arm64-v8a , I checked and it was there indeed.

If you need a more complete log, just let me know. Thanks!

@MikuAuahDark
Copy link
Collaborator

The AAB is used to upload your games to Play Store. Since you gonna modify LOVE Android anyway, then you have to build the AAB yourself.

I'm not sure with now, but AFAIK debugging works on me in the past using real phone running Android 10 with Android Studio 4.2.1. If you're trying to debug with AVD, make sure to use Android 11 AVD. Android 10 AVD and earlier lacks ARM binary translator.

@MikuAuahDark
Copy link
Collaborator

Hang on. What Android Studio version are you on?

While trying to fix love2d/love#1722, I start to get same issue when pressing "Run" or "Debug". The culprit is "There are no .so files available to package in the APK for x86.", but this happends on me recently in Android Studio 2020.3.1.

MikuAuahDark added a commit that referenced this issue Aug 21, 2021
This workaround problems on debugging/running from Android Studio. See #208
@castelo3442
Copy link
Author

It started when I updated a lot of stuff, including to Android Studio Arctic fox. But then I`ve tried with 3.x. and 4.x.x, and I have the same problem in all of them

@MikuAuahDark
Copy link
Collaborator

So it seems Android Studio filters the native libraries before pushing it to the emulator/device and if there are no matching ABI found, then it will crash because they're simply not compiled for the particular ABI.

I've added x86_64 as supported ABI in ae0d894 but only in debug builds, just to let Android Studio found matching ABI when debugging, but you need to use x86_64 (or x86 Atom_64) system image instead of x86 (32-bit) system image.

Speaking of x86 and x86_64 ABI, I plan to support ChromeOS later so supporting x86 and x86_64 architecture as a whole might be possible someday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants