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 long com.google.androidgamesdk.GameActivity.initializeNativeCode #101

Closed
torokati44 opened this issue Aug 2, 2023 · 6 comments

Comments

@torokati44
Copy link

torokati44 commented Aug 2, 2023

After updating android-activity from 0.4.2 to 0.4.3, and androidx.games:games-activity from 1.1.0 to 2.0.2, I get this error when I'm creating the GameActivity subclass instance:

No implementation found for long com.google.androidgamesdk.GameActivity.initializeNativeCode(java.lang.String, java.lang.String, java.lang.String, android.content.res.AssetManager, byte[], android.content.res.Configuration) (tried Java_com_google_androidgamesdk_GameActivity_initializeNativeCode and Java_com_google_androidgamesdk_GameActivity_initializeNativeCode__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Landroid_content_res_AssetManager_2_3BLandroid_content_res_Configuration_2)

AndroidRuntime: java.lang.UnsatisfiedLinkError: No implementation found for long com.google.androidgamesdk.GameActivity.initializeNativeCode(java.lang.String, java.lang.String, java.lang.String, android.content.res.AssetManager, byte[], android.content.res.Configuration) (tried Java_com_google_androidgamesdk_GameActivity_initializeNativeCode and Java_com_google_androidgamesdk_GameActivity_initializeNativeCode__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Landroid_content_res_AssetManager_2_3BLandroid_content_res_Configuration_2)
08-02 15:09:41.127 15805 15805 E AndroidRuntime:        at com.google.androidgamesdk.GameActivity.initializeNativeCode(Native Method)
08-02 15:09:41.127 15805 15805 E AndroidRuntime:        at com.google.androidgamesdk.GameActivity.onCreate(GameActivity.java:322)
08-02 15:09:41.127 15805 15805 E AndroidRuntime:        at rs.ruffle.FullscreenNativeActivity.onCreate(FullscreenNativeActivity.java:221)
08-02 15:09:41.127 15805 15805 E AndroidRuntime:        at android.app.Activity.performCreate(Activity.java:8342)
08-02 15:09:41.127 15805 15805 E AndroidRuntime:        at android.app.Activity.performCreate(Activity.java:8321)
08-02 15:09:41.127 15805 15805 E AndroidRuntime:        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1417)
08-02 15:09:41.127 15805 15805 E AndroidRuntime:        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3625)
08-02 15:09:41.127 15805 15805 E AndroidRuntime:        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3781)
08-02 15:09:41.127 15805 15805 E AndroidRuntime:        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
08-02 15:09:41.127 15805 15805 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:138)
08-02 15:09:41.127 15805 15805 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
08-02 15:09:41.127 15805 15805 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2306)
08-02 15:09:41.127 15805 15805 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:106)
08-02 15:09:41.127 15805 15805 E AndroidRuntime:        at android.os.Looper.loopOnce(Looper.java:201)
08-02 15:09:41.127 15805 15805 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:288)
08-02 15:09:41.127 15805 15805 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7918)
08-02 15:09:41.127 15805 15805 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
08-02 15:09:41.127 15805 15805 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
08-02 15:09:41.127 15805 15805 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

This is with: https://github.com/torokati44/ruffle-android/actions/runs/5739934997
The last working build was: https://github.com/torokati44/ruffle-android/actions/runs/5739934006

This is all that's changed between the working and crashing builds: ruffle-rs/ruffle-android@99aae5f

EDIT: I've updated the "last working build" so the regressing diff is smaller and more relevant ... again.

@torokati44
Copy link
Author

Apart from changing these two version numbers, should I make any code changes to make it work?
Such as, implement GameActivity.initializeNativeCode?

@torokati44
Copy link
Author

Ooooohhh, my mistake, I thought the 0.4.3 release already included the switch to GameActivity 2.0.2... 🤦

@rib
Copy link
Member

rib commented Aug 3, 2023

ah right, yeah, the update to GameActivity 2.0.2 will be part of a 0.5 release, hopefully soon.

I did consider releasing the update as part of a 0.4 release (since it's ambiguous whether we should treat it as a semver break for the crate) but since there were other reasons for needing a 0.5 release anyway I decided I'd include it in 0.5 instead.

Before releasing 0.5 I have an input API update I also want to land for exposing KeyCharacterMap bindings that enable support for unicode character mapping. This required a change to the .input_events() API.

I'd like to have 0.5 available for Winit 0.29 which should be released soonish

@torokati44
Copy link
Author

Was GameActivity 1.2[.2] ever supported BTW? Because I tried that too, with android-activity 0.4.2, and got the same error.

@rib
Copy link
Member

rib commented Aug 3, 2023

#88 was the first time doing an update since I first bootstrapped GameActivity support.

Previously GameActivity was based on a snapshot from Git taken on May 25th 2022, and required several patches to even get it to compile. The base commit from https://android.googlesource.com/platform/frameworks/opt/gamesdk/ was e8c66318443e5c864395725d7e4416d5b46242f8 I believe.

This fell between 1.1.0 and 1.2.0, but yeah that was before they enabled "derived classes of GameActivity to handle native library loading" which I guess is when initializeNativeCode was added.

We need to maintain fewer patches to the GameActivity code now so I'd guess it should be easier to track releases too.

It's nicer that this update corresponds to a specific 2.0.2 release.

@torokati44
Copy link
Author

I see, thanks! I'll wait for winit 0.29 and android-activity 0.5 before switching to GameActivity 2.0.2 then, skipping the 1.2 series. I have no issues with 1.1, just wanted to keep up with the times!

@torokati44 torokati44 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 3, 2023
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