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

GameActivity signatures changed #150

Open
fr-an-k opened this issue Jan 23, 2024 · 3 comments
Open

GameActivity signatures changed #150

fr-an-k opened this issue Jan 23, 2024 · 3 comments

Comments

@fr-an-k
Copy link

fr-an-k commented Jan 23, 2024

If I update everything to the latest versions in agdk-winit-wgpu, fix the compiler errors and run it on Android 13, I get:

2024-01-23 11:37:20.493 13371-13371 ziparchive              co.realfit.agdkwinitwgpu             W  Unable to open '/data/app/~~LSI_5mJf29Bl_b5EuqfyXw==/co.realfit.agdkwinitwgpu-4kKnH-F6FYdZQ4NZckZrRA==/base.dm': No such file or directory
2024-01-23 11:37:20.493 13371-13371 ziparchive              co.realfit.agdkwinitwgpu             W  Unable to open '/data/app/~~LSI_5mJf29Bl_b5EuqfyXw==/co.realfit.agdkwinitwgpu-4kKnH-F6FYdZQ4NZckZrRA==/base.dm': No such file or directory
2024-01-23 11:37:20.500 24981-25927 RecentsModel            com.miui.home                        W  getRunningTask   taskInfo=TaskInfo{userId=0 taskId=1619 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=co.realfit.agdkwinitwgpu/.MainActivity } baseActivity=ComponentInfo{co.realfit.agdkwinitwgpu/co.realfit.agdkwinitwgpu.MainActivity} topActivity=ComponentInfo{co.realfit.agdkwinitwgpu/co.realfit.agdkwinitwgpu.MainActivity} origActivity=null realActivity=ComponentInfo{co.realfit.agdkwinitwgpu/co.realfit.agdkwinitwgpu.MainActivity} numActivities=1 lastActiveTime=528176980 supportsSplitScreenMultiWindow=true supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=200 token=WCT{android.window.IWindowContainerToken$Stub$Proxy@9df0115} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=0 displayCutoutSafeInsets=Rect(0, 93 - 0, 0) topActivityInfo=ActivityInfo{1860c2a co.realfit.agdkwinitwgpu.MainActivity} launchCookies=[] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=true isVisible=true isSleeping=false topActivityInSizeCompat=false topActivityInMiuiSizeCompat=false topActivityEligibleForLetterboxEducation= false locusId=null displayAreaFeatureId=1 cameraCompatControlState=hidden mIsCastMode=false}
2024-01-23 11:37:20.500 24981-25927 RecentsModel            com.miui.home                        W  getTaskInfoIgnoreHomeAndFreeform   taskInfo=ComponentInfo{co.realfit.agdkwinitwgpu/co.realfit.agdkwinitwgpu.MainActivity}
2024-01-23 11:37:20.504 24981-25927 ActivityManagerWrapper  com.miui.home                        E  getRecentTasks: mainTaskId=1619   userId=0   baseIntent=Intent { act=android.intent.action.MAIN flag=270532608 cmp=ComponentInfo{co.realfit.agdkwinitwgpu/co.realfit.agdkwinitwgpu.MainActivity} }
2024-01-23 11:37:20.572 13371-13371 nativeloader            co.realfit.agdkwinitwgpu             D  Configuring clns-4 for other apk /data/app/~~LSI_5mJf29Bl_b5EuqfyXw==/co.realfit.agdkwinitwgpu-4kKnH-F6FYdZQ4NZckZrRA==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~LSI_5mJf29Bl_b5EuqfyXw==/co.realfit.agdkwinitwgpu-4kKnH-F6FYdZQ4NZckZrRA==/lib/arm64:/data/app/~~LSI_5mJf29Bl_b5EuqfyXw==/co.realfit.agdkwinitwgpu-4kKnH-F6FYdZQ4NZckZrRA==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/co.realfit.agdkwinitwgpu
2024-01-23 11:37:20.585 13371-13371 GraphicsEnvironment     co.realfit.agdkwinitwgpu             V  ANGLE Developer option for 'co.realfit.agdkwinitwgpu' set to: 'default'
2024-01-23 11:37:20.586 13371-13371 GraphicsEnvironment     co.realfit.agdkwinitwgpu             V  ANGLE GameManagerService for co.realfit.agdkwinitwgpu: false
2024-01-23 11:37:20.586 13371-13371 GraphicsEnvironment     co.realfit.agdkwinitwgpu             V  Neither updatable production driver nor prerelease driver is supported.
2024-01-23 11:37:20.593  1638-1966  UiModeManager           system_server                        I  systemserver package:co.realfit.agdkwinitwgpu null
2024-01-23 11:37:20.593 13371-13371 ForceDarkHelperStubImpl co.realfit.agdkwinitwgpu             I  initialize for co.realfit.agdkwinitwgpu , ForceDarkAppConfig: null
2024-01-23 11:37:20.594 13371-13371 t.agdkwinitwgpu         co.realfit.agdkwinitwgpu             D  JNI_OnLoad success
2024-01-23 11:37:20.594 13371-13371 MiuiForceDarkConfig     co.realfit.agdkwinitwgpu             I  setConfig density:2.750000, mainRule:0, secondaryRule:0, tertiaryRule:0
2024-01-23 11:37:20.598 13371-13371 NetworkSecurityConfig   co.realfit.agdkwinitwgpu             D  No Network Security Config specified, using platform default
2024-01-23 11:37:20.599 13371-13371 NetworkSecurityConfig   co.realfit.agdkwinitwgpu             D  No Network Security Config specified, using platform default
2024-01-23 11:37:20.600 13371-13371 Compatibil...geReporter co.realfit.agdkwinitwgpu             D  Compat change id reported: 183155436; UID 10366; state: ENABLED
2024-01-23 11:37:20.618 13371-13371 FileUtils               co.realfit.agdkwinitwgpu             E  err open mi_exception_log errno=2
2024-01-23 11:37:20.618 13371-13371 FileUtils               co.realfit.agdkwinitwgpu             E  err write to mi_exception_log
2024-01-23 11:37:20.622 13371-13371 MSYNC3-Var...efreshRate co.realfit.agdkwinitwgpu             I  Variable refreshrate is disabled
2024-01-23 11:37:20.624 13371-13392 PowerHalWrapper         co.realfit.agdkwinitwgpu             I  PowerHalWrapper.getInstance 
2024-01-23 11:37:20.627 13371-13396 libMEOW                 co.realfit.agdkwinitwgpu             D  meow new tls: 0xb400007232da43c0
2024-01-23 11:37:20.627 13371-13396 libMEOW                 co.realfit.agdkwinitwgpu             D  meow reload base cfg path: na
2024-01-23 11:37:20.627 13371-13396 libMEOW                 co.realfit.agdkwinitwgpu             D  meow reload overlay cfg path: na
2024-01-23 11:37:20.627 13371-13371 MiuiMultiWindowAdapter  co.realfit.agdkwinitwgpu             D  MiuiMultiWindowAdapter::getFreeformVideoWhiteListInSystem::LIST_ABOUT_SUPPORT_LANDSCAPE_VIDEO = [com.hunantv.imgo.activity, com.tencent.qqlive, com.qiyi.video, com.hunantv.imgo.activity.inter, com.tencent.qqlivei18n, com.iqiyi.i18n, tv.danmaku.bili]
2024-01-23 11:37:20.628 13371-13396 QT                      co.realfit.agdkwinitwgpu             E  [QT]file does not exist
2024-01-23 11:37:20.628 13371-13396 libMEOW                 co.realfit.agdkwinitwgpu             D  applied 1 plugins for [co.realfit.agdkwinitwgpu]:
2024-01-23 11:37:20.628 13371-13396 libMEOW                 co.realfit.agdkwinitwgpu             D    plugin 1: [libMEOW_gift.so]:
2024-01-23 11:37:20.628 13371-13396 libMEOW                 co.realfit.agdkwinitwgpu             D  meow delete tls: 0xb400007232da43c0
2024-01-23 11:37:20.638 13371-13371 AppCompatDelegate       co.realfit.agdkwinitwgpu             D  Checking for metadata for AppLocalesMetadataHolderService : Service not found
2024-01-23 11:37:20.658 13371-13371 IS_CTS_MODE             co.realfit.agdkwinitwgpu             D  false
2024-01-23 11:37:20.658 13371-13371 MULTI_WINDOW_ENABLED    co.realfit.agdkwinitwgpu             D  false
2024-01-23 11:37:20.662 13371-13371 DecorView[]             co.realfit.agdkwinitwgpu             D  getWindowModeFromSystem  windowmode is 1
2024-01-23 11:37:20.670 13371-13371 SurfaceFactory          co.realfit.agdkwinitwgpu             I  [static] sSurfaceFactory = com.mediatek.view.impl.SurfaceFactoryImpl@c832bd4
2024-01-23 11:37:20.670   960-1019  SurfaceFlinger          surfaceflinger                       D  [SF client] NEW(0xb40000786a376700) for (13371:co.realfit.agdkwinitwgpu)
2024-01-23 11:37:20.696 13371-13371 t.agdkwinitwgpu         co.realfit.agdkwinitwgpu             W  Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (unsupported, reflection, allowed)
2024-01-23 11:37:20.696 13371-13371 t.agdkwinitwgpu         co.realfit.agdkwinitwgpu             W  Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (unsupported, reflection, allowed)
2024-01-23 11:37:20.700 13371-13371 Compatibil...geReporter co.realfit.agdkwinitwgpu             D  Compat change id reported: 210923482; UID 10366; state: ENABLED
2024-01-23 11:37:20.712 13371-13371 GameActivity            co.realfit.agdkwinitwgpu             I  Looking for library libmain.so
2024-01-23 11:37:20.712 13371-13371 GameActivity            co.realfit.agdkwinitwgpu             I  Found library libmain.so. Loading...
2024-01-23 11:37:20.715 13371-13371 GameActivity            co.realfit.agdkwinitwgpu             D  GameActivity_register
2024-01-23 11:37:20.716 13371-13371 GameActivity            co.realfit.agdkwinitwgpu             V  Registering com/google/androidgamesdk/GameActivity's 22 native methods...
2024-01-23 11:37:20.716 13371-13371 t.agdkwinitwgpu         co.realfit.agdkwinitwgpu             W  CheckJNI: method to register "initializeNativeCode" not in the given class. This is slow, consider changing your RegisterNatives calls.
2024-01-23 11:37:20.716 13371-13371 t.agdkwinitwgpu         co.realfit.agdkwinitwgpu             E  ----- class 'Lcom/google/androidgamesdk/GameActivity;' cl=0x12c34a88 -----
                                                                                                      objectSize=5608 (5276 from super)
                                                                                                      access=0x0000.0001
                                                                                                      super='java.lang.Class<androidx.appcompat.app.AppCompatActivity>' (cl=0x12c34a88)
                                                                                                      interfaces (3):
                                                                                                         0: java.lang.Class<android.view.SurfaceHolder$Callback2> (cl=0x0)
                                                                                                         1: java.lang.Class<com.google.androidgamesdk.gametextinput.Listener> (cl=0x12c34a88)
                                                                                                         2: java.lang.Class<androidx.core.view.OnApplyWindowInsetsListener> (cl=0x12c34a88)
                                                                                                      vtable (54 entries, 48 in super):
                                                                                                         0: java.lang.String com.google.androidgamesdk.GameActivity.getDlError()
                                                                                                         1: long com.google.androidgamesdk.GameActivity.getGameActivityNativeHandle()
                                                                                                         2: android.view.inputmethod.EditorInfo com.google.androidgamesdk.GameActivity.getImeEditorInfo()
                                                                                                         3: androidx.core.graphics.Insets com.google.androidgamesdk.GameActivity.getWaterfallInsets()
                                                                                                         4: androidx.core.graphics.Insets com.google.androidgamesdk.GameActivity.getWindowInsets(int)
                                                                                                         5: long com.google.androidgamesdk.GameActivity.initializeNativeCode(java.lang.String, java.lang.String, java.lang.String, android.content.res.AssetManager, byte[])
                                                                                                         6: androidx.core.view.WindowInsetsCompat com.google.androidgamesdk.GameActivity.onApplyWindowInsets(android.view.View, androidx.core.view.WindowInsetsCompat)
                                                                                                         7: void com.google.androidgamesdk.GameActivity.onConfigurationChanged(android.content.res.Configuration)
                                                                                                         8: void com.google.androidgamesdk.GameActivity.onConfigurationChangedNative(long)
                                                                                                         9: void com.google.androidgamesdk.GameActivity.onCreate(android.os.Bundle)
                                                                                                        10: void com.google.androidgamesdk.GameActivity.onCreateSurfaceView()
                                                                                                        11: void com.google.androidgamesdk.GameActivity.onDestroy()
                                                                                                        12: boolean com.google.androidgamesdk.GameActivity.onGenericMotionEvent(android.view.MotionEvent)
                                                                                                        13: void com.google.androidgamesdk.GameActivity.onImeInsetsChanged(androidx.core.graphics.Insets)
                                                                                                        14: boolean com.google.androidgamesdk.GameActivity.onKeyDown(int, android.view.KeyEvent)
                                                                                                        15: boolean com.google.androidgamesdk.GameActivity.onKeyDownNative(long, android.view.KeyEvent)
                                                                                                        16: boolean com.google.androidgamesdk.GameActivity.onKeyUp(int, android.view.KeyEvent)
                                                                                                        17: boolean com.google.androidgamesdk.GameActivity.onKeyUpNative(long, android.view.KeyEvent)
                                                                                                        18: void com.google.androidgamesdk.GameActivity.onPause()
                                                                                                        19: void com.google.androidgamesdk.GameActivity.onPauseNative(long)
                                                                                                        20: void com.google.androidgamesdk.GameActivity.onResume()
                                                                                                        21: void com.google.androidgamesdk.GameActivity.onResumeNative(long)
                                                                                                        22: void com.google.androidgamesdk.GameActivity.onSaveInstanceState(android.os.Bundle)
                                                                                                        23: byte[] com.google.androidgamesdk.GameActivity.onSaveInstanceStateNative(long)
                                                                                                        24: void com.google.androidgamesdk.GameActivity.onSetUpWindow()
                                                                                                        25: void com.google.androidgamesdk.GameActivity.onStart()
                                                                                                        26: void com.google.androidgamesdk.GameActivity.onStartNative(long)
                                                                                                        27: void com.google.androidgamesdk.GameActivity.onStop()
                                                                                                        28: void com.google.androidgamesdk.GameActivity.onStopNative(long)
                                                                                                        29: void com.google.androidgamesdk.GameActivity.onSurfaceChangedNative(long, android.view.Surface, int, int, int)
                                                                                                        30: void com.google.androidgamesdk.GameActivity.onSurfaceCreatedNative(long, android.view.Surface)
                                                                                                        31: void com.google.androidgamesdk.GameActivity.onSurfaceDestroyedNative(long)
                                                                                                        32: void com.google.androidgamesdk.GameActivity.onSurfaceRedrawNeededNative(long, android.view.Surface)
                                                                                                        33: void com.google.androidgamesdk.GameActivity.onTextInputEventNative(long, com.google.androidgamesdk.gametextinput.State)
                                                                                                        34: boolean com.google.androidgamesdk.GameActivity.onTouchEvent(android.view.MotionEvent)
                                                                                                        35: boolean com.google.androidgamesdk.GameActivity.onTouchEventNative(long, android.view.MotionEvent)
                                                                                                        36: void com.google.androidgamesdk.GameActivity.onTrimMemory(int)
                                                                                                        37: void com.google.androidgamesdk.GameActivity.onTrimMemoryNative(long, int)
2024-01-23 11:37:20.716 13371-13371 t.agdkwinitwgpu         co.realfit.agdkwinitwgpu             E      38: void com.google.androidgamesdk.GameActivity.onWindowFocusChanged(boolean)
                                                                                                        39: void com.google.androidgamesdk.GameActivity.onWindowFocusChangedNative(long, boolean)
                                                                                                        40: void com.google.androidgamesdk.GameActivity.onWindowInsetsChangedNative(long)
                                                                                                        41: void com.google.androidgamesdk.GameActivity.setImeEditorInfo(android.view.inputmethod.EditorInfo)
                                                                                                        42: void com.google.androidgamesdk.GameActivity.setImeEditorInfoFields(int, int, int)
                                                                                                        43: void com.google.androidgamesdk.GameActivity.setInputConnectionNative(long, com.google.androidgamesdk.gametextinput.InputConnection)
                                                                                                        44: void com.google.androidgamesdk.GameActivity.setTextInputState(com.google.androidgamesdk.gametextinput.State)
                                                                                                        45: void com.google.androidgamesdk.GameActivity.setWindowFlags(int, int)
                                                                                                        46: void com.google.androidgamesdk.GameActivity.setWindowFormat(int)
                                                                                                        47: void com.google.androidgamesdk.GameActivity.stateChanged(com.google.androidgamesdk.gametextinput.State, boolean)
                                                                                                        48: void com.google.androidgamesdk.GameActivity.surfaceChanged(android.view.SurfaceHolder, int, int, int)
                                                                                                        49: void com.google.androidgamesdk.GameActivity.surfaceCreated(android.view.SurfaceHolder)
                                                                                                        50: void com.google.androidgamesdk.GameActivity.surfaceDestroyed(android.view.SurfaceHolder)
                                                                                                        51: void com.google.androidgamesdk.GameActivity.surfaceRedrawNeeded(android.view.SurfaceHolder)
                                                                                                        52: void com.google.androidgamesdk.GameActivity.terminateNativeCode(long)
                                                                                                        53: void android.view.SurfaceHolder$Callback2.surfaceRedrawNeededAsync(android.view.SurfaceHolder, java.lang.Runnable)
                                                                                                      direct methods (2 entries):
                                                                                                         0: void com.google.androidgamesdk.GameActivity.<init>()
                                                                                                         1: java.lang.String com.google.androidgamesdk.GameActivity.getAbsolutePath(java.io.File)
                                                                                                      static fields (4 entries):
                                                                                                         0: java.lang.String com.google.androidgamesdk.GameActivity.DEFAULT_NATIVE_LIB_NAME
                                                                                                         1: java.lang.String com.google.androidgamesdk.GameActivity.KEY_NATIVE_SAVED_STATE
                                                                                                         2: java.lang.String com.google.androidgamesdk.GameActivity.LOG_TAG
                                                                                                         3: java.lang.String com.google.androidgamesdk.GameActivity.META_DATA_LIB_NAME
                                                                                                      instance fields (7 entries):
                                                                                                         0: int com.google.androidgamesdk.GameActivity.contentViewId
                                                                                                         1: android.view.inputmethod.EditorInfo com.google.androidgamesdk.GameActivity.imeEditorInfo
                                                                                                         2: android.view.SurfaceHolder com.google.androidgamesdk.GameActivity.mCurSurfaceHolder
                                                                                                         3: boolean com.google.androidgamesdk.GameActivity.mDestroyed
                                                                                                         4: int[] com.google.androidgamesdk.GameActivity.mLocation
                                                                                                         5: long com.google.androidgamesdk.GameActivity.mNativeHandle
                                                                                                         6: com.google.androidgamesdk.GameActivity$InputEnabledSurfaceView com.google.androidgamesdk.GameActivity.mSurfaceView
2024-01-23 11:37:20.716 13371-13371 t.agdkwinitwgpu         co.realfit.agdkwinitwgpu             E  Failed to register native method com.google.androidgamesdk.GameActivity.initializeNativeCode(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/content/res/AssetManager;[BLandroid/content/res/Configuration;)J in /data/app/~~LSI_5mJf29Bl_b5EuqfyXw==/co.realfit.agdkwinitwgpu-4kKnH-F6FYdZQ4NZckZrRA==/base.apk
2024-01-23 11:37:20.716 13371-13371 System.err              co.realfit.agdkwinitwgpu             W  java.lang.NoSuchMethodError: no static or non-static method "Lcom/google/androidgamesdk/GameActivity;.initializeNativeCode(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/content/res/AssetManager;[BLandroid/content/res/Configuration;)J"
2024-01-23 11:37:20.717 13371-13371 System.err              co.realfit.agdkwinitwgpu             W  	at com.google.androidgamesdk.GameActivity.initializeNativeCode(Native Method)
2024-01-23 11:37:20.717 13371-13371 System.err              co.realfit.agdkwinitwgpu             W  	at com.google.androidgamesdk.GameActivity.onCreate(GameActivity.java:271)
2024-01-23 11:37:20.717 13371-13371 System.err              co.realfit.agdkwinitwgpu             W  	at co.realfit.agdkwinitwgpu.MainActivity.onCreate(MainActivity.java:63)
2024-01-23 11:37:20.717 13371-13371 System.err              co.realfit.agdkwinitwgpu             W  	at android.app.Activity.performCreate(Activity.java:8523)
2024-01-23 11:37:20.717 13371-13371 System.err              co.realfit.agdkwinitwgpu             W  	at android.app.Activity.performCreate(Activity.java:8487)
2024-01-23 11:37:20.717 13371-13371 System.err              co.realfit.agdkwinitwgpu             W  	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1437)
2024-01-23 11:37:20.717 13371-13371 System.err              co.realfit.agdkwinitwgpu             W  	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3853)
2024-01-23 11:37:20.717 13371-13371 System.err              co.realfit.agdkwinitwgpu             W  	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4018)
2024-01-23 11:37:20.717 13371-13371 System.err              co.realfit.agdkwinitwgpu             W  	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
2024-01-23 11:37:20.717 13371-13371 System.err              co.realfit.agdkwinitwgpu             W  	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
2024-01-23 11:37:20.717 13371-13371 System.err              co.realfit.agdkwinitwgpu             W  	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
2024-01-23 11:37:20.717 13371-13371 System.err              co.realfit.agdkwinitwgpu             W  	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2427)
2024-01-23 11:37:20.718 13371-13371 System.err              co.realfit.agdkwinitwgpu             W  	at android.os.Handler.dispatchMessage(Handler.java:106)
2024-01-23 11:37:20.718 13371-13371 System.err              co.realfit.agdkwinitwgpu             W  	at android.os.Looper.loopOnce(Looper.java:211)
2024-01-23 11:37:20.718 13371-13371 System.err              co.realfit.agdkwinitwgpu             W  	at android.os.Looper.loop(Looper.java:300)
2024-01-23 11:37:20.718 13371-13371 System.err              co.realfit.agdkwinitwgpu             W  	at android.app.ActivityThread.main(ActivityThread.java:8232)
2024-01-23 11:37:20.718 13371-13371 System.err              co.realfit.agdkwinitwgpu             W  	at java.lang.reflect.Method.invoke(Native Method)
2024-01-23 11:37:20.718 13371-13371 System.err              co.realfit.agdkwinitwgpu             W  	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
2024-01-23 11:37:20.718 13371-13371 System.err              co.realfit.agdkwinitwgpu             W  	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1028)

build.gradle:

plugins {
    id 'com.android.application' version '8.1.0' apply false
    id 'com.android.library' version '8.1.0' apply false
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

app/build.gradle:

plugins {
    id 'com.android.application'
}

android {
    ndkVersion "26.1.10909125"
    compileSdk 34

    defaultConfig {
        applicationId "co.realfit.agdkwinitwgpu"
        minSdk 19
        targetSdk 34
        versionCode 1
        versionName "1.0"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        debug {
            minifyEnabled false
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    namespace 'co.realfit.agdkwinitwgpu'

    buildFeatures.prefab true
}

dependencies {
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.11.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'androidx.core:core:1.9.0'
    implementation "androidx.games:games-activity:1.2.2"
}

Cargo.toml:

[package]
name = "agdk-winit-wgpu"
version = "0.1.0"
edition = "2021"

[dependencies]
log = "0.4"
winit = { version = "0.29", features = ["android-game-activity"]}
wgpu = "0.19"
pollster = "0.3"

[target.'cfg(not(target_os = "android"))'.dependencies]
env_logger = "0.11"

[target.'cfg(target_os = "android")'.dependencies]
android_logger = "0.13"

[features]
default = []
desktop = []

[lib]
name="main"
crate_type=["cdylib"]

[[bin]]
path="src/lib.rs"
name="test-winit-wgpu"
required-features = [ "desktop" ]

So the last parameter of initializeNativeCode is a byte[] now, instead of android.content.res.Configuration.

I tried with various combinations of versions, but it looks like the GameActivity method signatures have changed (g_methods) and need to be updated at some point in order to keep up, possibly other changes as well. I'm just opening a case for it.

The example works with winit 0.28 and wgpu 0.18 (after fixing some compiler errors) so that can be used for now.

@fr-an-k fr-an-k changed the title GameLibrary signatures changed GameActivity signatures changed Jan 23, 2024
@fr-an-k
Copy link
Author

fr-an-k commented Feb 13, 2024

Somehow it works now, on multiple android devices (still winit 0.29.10);
I guess I just did something wrong (I did clear the caches and whatnot).

@fr-an-k fr-an-k closed this as completed Feb 13, 2024
@fr-an-k
Copy link
Author

fr-an-k commented Feb 15, 2024

The issue occurs when you update the android dependencies in app/build.gradle (as provided by agdk apps in rust-android-examples repository) to a more recent version.
androidx.games:games-activity:1.1.0 -> 1.2.2
androidx.appcompat:appcompat:1.4.1 -> 1.6.1

The android-activity code (signatures) have to be changed at some point to support new/fixed functionality from these linked java classes as support for the older version wanes.

@fr-an-k fr-an-k reopened this Feb 15, 2024
@xdray
Copy link

xdray commented Apr 8, 2024

i found this, androidx.games:games-activity package version in gradle must match version in android-activity/game-activity-csrc/game-activity/GameActivity.h

#define GAMEACTIVITY_MAJOR_VERSION 2
#define GAMEACTIVITY_MINOR_VERSION 0
#define GAMEACTIVITY_BUGFIX_VERSION 2
#define GAMEACTIVITY_PACKED_VERSION

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