앱이 Android 14(API 수준 34) 이상을 타겟팅해야 함
앱 업데이트를 출시할 수 없게 됩니다(46일 남음).
제발 그냥 되면 좋겠다.
1. Edit - Player - Target API Level 변경.
다행히도 현재 사용중인 2021.3.23f1 LTS 버전에서 API 34를 설정할 수 있다.
그렇게 해피 엔딩일 줄 알았건만 ...
안드로이드 14 단말기에서 앱이 시작되자마자 강제 종료된다.
그것도 모르고 구글 스토어에 등록 후 배포를 해버렸다. 이런 젠장...
<
>
--------- beginning of crash 2024-07-16 21:50:36.564 19644-19644/com.ships.api34fuck E/AndroidRuntime: FATAL EXCEPTION: main Process: com.ships.api34fuck, PID: 19644 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ships.api34fuck/com.unity3d.player.UnityPlayerActivity}: java.lang.SecurityException: com.ships.api34fuck: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4164) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4322) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2685) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:230) at android.os.Looper.loop(Looper.java:319) at android.app.ActivityThread.main(ActivityThread.java:8919) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103) Caused by: java.lang.SecurityException: com.ships.api34fuck: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts at android.os.Parcel.createExceptionOrNull(Parcel.java:3069) at android.os.Parcel.createException(Parcel.java:3053) at android.os.Parcel.readException(Parcel.java:3036) at android.os.Parcel.readException(Parcel.java:2978) at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:6157) at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1913) at android.app.ContextImpl.registerReceiver(ContextImpl.java:1853) at android.app.ContextImpl.registerReceiver(ContextImpl.java:1841) at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:772) at com.unity3d.player.UnityPlayer.<init>(Unknown Source:343) at com.unity3d.player.UnityPlayerActivity.onCreate(UnityPlayerActivity.java:40) at android.app.Activity.performCreate(Activity.java:8975) at android.app.Activity.performCreate(Activity.java:8944) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1456) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4146) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4322) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2685) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:230) at android.os.Looper.loop(Looper.java:319) at android.app.ActivityThread.main(ActivityThread.java:8919) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103) Caused by: android.os.RemoteException: Remote stack trace: at com.android.server.am.ActivityManagerService.registerReceiverWithFeature(ActivityManagerService.java:16680) at android.app.IActivityManager$Stub.onTransact$registerReceiverWithFeature$(IActivityManager.java:11613) at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2961) at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3199) at android.os.Binder.execTransactInternal(Binder.java:1375) | cs |
One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be
specified when a receiver isn't being registered exclusively
for system broadcasts
대충 정리해 보면 안드로이드 14부터는 브로드캐스트 리시버를 등록할 때 반드시
위 2가지 플래그 중 하나를 명시적으로 지정해야 한다는 얘기라는데 어디서 해야 할까?
2. [ANDROID] TARGET API 34 CRASH ON LAUNCH
유니티 버그다.
2021 LTS 버전의 경우 2021.3.33f1 버전에서 수정했다고 한다.
2021.3.40f1 최신 버전을 다운 받자.
3. java.lang.SecurityException: "Writable dex file is not allowed."
<
>
2024-07-16 22:38:39.421 24558-24807/com.ships.api34fuck E/mes.api34fuck: Attempt to load writable dex file: /data/user/0/com.ships.api34fuck/cache/app_resources_lib.jar 2024-07-16 22:38:39.422 24558-24807/com.ships.api34fuck D/CompatibilityChangeReporter: Compat change id reported: 218865702; UID 10377; state: ENABLED 2024-07-16 22:38:39.422 24558-24807/com.ships.api34fuck A/mes.api34fuck: java_vm_ext.cc:591] JNI DETECTED ERROR IN APPLICATION: JNI NewStringUTF called with pending exception java.lang.SecurityException: Writable dex file '/data/user/0/com.ships.api34fuck/cache/app_resources_lib.jar' is not allowed. java_vm_ext.cc:591] at java.lang.Object dalvik.system.DexFile.openDexFileNative(java.lang.String, java.lang.String, int, java.lang.ClassLoader, dalvik.system.DexPathList$Element[]) (DexFile.java:-2) java_vm_ext.cc:591] at java.lang.Object dalvik.system.DexFile.openDexFile(java.lang.String, java.lang.String, int, java.lang.ClassLoader, dalvik.system.DexPathList$Element[]) (DexFile.java:406) java_vm_ext.cc:591] at void dalvik.system.DexFile.<init>(java.lang.String, java.lang.ClassLoader, dalvik.system.DexPathList$Element[]) (DexFile.java:128) java_vm_ext.cc:591] at void dalvik.system.DexFile.<init>(java.io.File, java.lang.ClassLoader, dalvik.system.DexPathList$Element[]) (DexFile.java:101) java_vm_ext.cc:591] at dalvik.system.DexFile dalvik.system.DexPathList.loadDexFile(java.io.File, java.io.File, java.lang.ClassLoader, dalvik.system.DexPathList$Element[]) (DexPathList.java:438) java_vm_ext.cc:591] at dalvik.system.DexPathList$Element[] dalvik.system.DexPathList.makeDexElements(java.util.List, java.io.File, java.util.List, java.lang.ClassLoader, boolean) (DexPathList.java:397) java_vm_ext.cc:591] at void dalvik.system.DexPathList.<init>(java.lang.ClassLoader, java.lang.String, java.lang.String, java.io.File, boolean) (DexPathList.java:166) java_vm_ext.cc:591] at void dalvik.system.BaseDexClassLoader.<init>(java.lang.String, java.lang.String, java.lang.ClassLoader, java.lang.ClassLoader[], java.lang.ClassLoader[], boolean) (BaseDexClassLoader.java:160) java_vm_ext.cc:591] at void dalvik.system.BaseDexClassLoader.<init>(java.lang.String, java.io.File, java.lang.String, java.lang.ClassLoader) (BaseDexClassLoader.java:105) java_vm_ext.cc:591] at void dalvik.system.DexClassLoader.<init>(java.lang.String, java.lang.String, java.lang.String, java.lang.ClassLoader) (DexClassLoader.java:55) java_vm_ext.cc:591] java_vm_ext.cc:591] in call to NewStringUTF 2024-07-16 22:38:39.563 24558-24614/com.ships.api34fuck D/Unity: ANativeWindow: (2208/1768) RequestedResolution: (1919/1537) RenderingResolution: (1919/1537) EGLSurface: (1919/1537) 2024-07-16 22:38:39.577 24558-24807/com.ships.api34fuck A/mes.api34fuck: runtime.cc:691] Runtime aborting... ... 중간 생략 ... 2024-07-16 22:38:39.578 24558-24807/com.ships.api34fuck E/CRASH: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 2024-07-16 22:38:39.578 24558-24807/com.ships.api34fuck E/CRASH: Version '2021.3.40f1 (6fcab7dbbbc1)', Build type 'Development', Scripting Backend 'il2cpp', CPU 'arm64-v8a' 2024-07-16 22:38:39.578 24558-24807/com.ships.api34fuck E/CRASH: Build fingerprint: 'samsung/q2qksx/q2q:14/UP1A.231005.007/F926NKSS3IXF2:user/release-keys' 2024-07-16 22:38:39.578 24558-24807/com.ships.api34fuck E/CRASH: Revision: '9' 2024-07-16 22:38:39.578 24558-24807/com.ships.api34fuck E/CRASH: ABI: 'arm64' 2024-07-16 22:38:39.578 24558-24807/com.ships.api34fuck E/CRASH: Timestamp: 2024-07-16 22:38:39+0900 2024-07-16 22:38:39.578 24558-24807/com.ships.api34fuck E/CRASH: pid: 24558, tid: 24807, name: Thread-17 >>> com.ships.api34fuck <<< 2024-07-16 22:38:39.578 24558-24807/com.ships.api34fuck E/CRASH: uid: 10377 2024-07-16 22:38:39.578 24558-24807/com.ships.api34fuck E/CRASH: signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr -------- 2024-07-16 22:38:39.578 24558-24807/com.ships.api34fuck E/CRASH: x0 0000000000000000 x1 00000000000060e7 x2 0000000000000006 x3 0000006c4012bdb0 2024-07-16 22:38:39.578 24558-24807/com.ships.api34fuck E/CRASH: x4 fefeff6b3f11afb7 x5 fefeff6b3f11afb7 x6 fefeff6b3f11afb7 x7 7f7f7f7f7f7fffff 2024-07-16 22:38:39.578 24558-24807/com.ships.api34fuck E/CRASH: x8 00000000000000f0 x9 00000070fa275278 x10 0000000000000001 x11 00000070fa2bda48 2024-07-16 22:38:39.578 24558-24807/com.ships.api34fuck E/CRASH: x12 000000000000e3b2 x13 0000000000000000 x14 0000006c4012abb0 x15 0000000034155555 2024-07-16 22:38:39.578 24558-24807/com.ships.api34fuck E/CRASH: x16 00000070fa326d18 x17 00000070fa301560 x18 0000006c223b4000 x19 0000000000005fee 2024-07-16 22:38:39.578 24558-24807/com.ships.api34fuck E/CRASH: x20 00000000000060e7 x21 00000000ffffffff x22 0000000000000058 x23 0000006dff8a3881 2024-07-16 22:38:39.578 24558-24807/com.ships.api34fuck E/CRASH: x24 0000000000000058 x25 0000000000000001 x26 0000000000000000 x27 0000006e00416000 2024-07-16 22:38:39.578 24558-24807/com.ships.api34fuck E/CRASH: x28 b400006f2125fe50 x29 0000006c4012be30 2024-07-16 22:38:39.578 24558-24807/com.ships.api34fuck E/CRASH: sp 0000006c4012bd90 lr 00000070fa2ae744 pc 00000070fa2ae770 2024-07-16 22:38:39.578 24558-24807/com.ships.api34fuck E/CRASH: backtrace: 2024-07-16 22:38:39.578 24558-24807/com.ships.api34fuck E/CRASH: #00 pc 000000000005b770 /apex/com.android.runtime/lib64/bionic/libc.so (abort+168) (BuildId: 544bc6c8e3556e98efbc4406b97f6a3e) 2024-07-16 22:38:39.587 24558-24558/com.ships.api34fuck I/BLASTBufferQueue_Java: update, w= 2208 h= 1768 mName = ViewRootImpl@b54c3b7[UnityPlayerActivity] mNativeObject= 0x70412456f0 sc.mNativeObject= 0x6fd1236dd0 format= -3 caller= android.view.ViewRootImpl.updateBlastSurfaceIfNeeded:3017 android.view.ViewRootImpl.relayoutWindow:10131 android.view.ViewRootImpl.performTraversals:4110 android.view.ViewRootImpl.doTraversal:3288 android.view.ViewRootImpl$TraversalRunnable.run:11344 android.view.Choreographer$CallbackRecord.run:1689 2024-07-16 22:38:39.587 24558-24558/com.ships.api34fuck I/ViewRootImpl@b54c3b7[UnityPlayerActivity]: Relayout returned: old=(0,0,2208,1768) new=(0,0,2208,1768) relayoutAsync=false req=(2208,1768)0 dur=5 res=0x400 s={true 0x6f612484b0} ch=false seqId=1 2024-07-16 22:38:39.587 24558-24759/com.ships.api34fuck D/Unity: Requested framebuffer: resolution[1919x1537], rgba[8/8/8/8], depth+stencil[on], samples[2] 2024-07-16 22:38:39.587 24558-24759/com.ships.api34fuck D/Unity: Created framebuffer: resolution[1919x1537], rgba[8/8/8/8], depth+stencil[24/8], samples[2] (MSAA) 2024-07-16 22:38:39.596 24558-24759/com.ships.api34fuck I/BLASTBufferQueue: [SurfaceView[com.ships.api34fuck/com.unity3d.player.UnityPlayerActivity]@0#1](f:0,a:0,s:0) onFrameAvailable the first frame is available 2024-07-16 22:38:39.920 24558-24807/com.ships.api34fuck E/CRASH: Forwarding signal 6 2024-07-16 22:38:39.921 24558-24807/com.ships.api34fuck A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 24807 (Thread-17), pid 24558 (mes.api34fuck) | cs |
최신 버전을 다운 로드 받고 빌드 후 산뜻한 마음으로 실행해 보지만...
기다리고 있는 건 엄청나게 긴 비정상 종료 로그 뿐이다.
프로젝트에서 firebase를 사용 중인데, v11.5.0 버전에서 이 문제를 수정했다고 한다.
Release note에는 다음과 같이 적혀 있다.
Made dynamic code files read only to comply with new Android 14 security
requirements. This fixes a crash at API level 34+.
이제는 firebase sdk를 변경해야 한다.
SDK 적용 과정은 생략한다.
4. Compilation error.
<
>
e: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors e: C:/Users/bpbuild/.gradle/caches/modules-2/files-2.1/androidx.annotation/annotation/1.5.0/857678d6b4ca7b28571ef7935c668bdb57e15027/annotation-1.5.0.jar!/META-INF/annotation.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.4.2. e: C:/Users/bpbuild/.gradle/caches/transforms-2/files-2.1/0462de0991e1719bb7d18e3b0b4e2e05/jetified-kotlin-stdlib-1.7.10.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.4.2. e: C:/Users/bpbuild/.gradle/caches/transforms-2/files-2.1/0e265759c7a59a05ebf9753eee05994d/jetified-kotlinx-coroutines-core-jvm-1.6.4.jar!/META-INF/kotlinx-coroutines-core.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.2. e: C:/Users/bpbuild/.gradle/caches/transforms-2/files-2.1/1cdda7c3d485f1f235d4b1e31acef50d/jetified-kotlinx-coroutines-android-1.6.4.jar!/META-INF/kotlinx-coroutines-android.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.2. e: C:/Users/bpbuild/.gradle/caches/transforms-2/files-2.1/4392fe96859757760b3f844ac2be4b9c/jetified-firebase-common-ktx-20.3.3-api.jar!/META-INF/com.google.firebase-firebase-common-ktx.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.4.2. e: C:/Users/bpbuild/.gradle/caches/transforms-2/files-2.1/6e9d1a71a7474ead3f2f456317743dc6/jetified-kotlin-stdlib-common-1.7.10.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.4.2. e: C:/Users/bpbuild/.gradle/caches/transforms-2/files-2.1/7313c44b501b0f498584f0a9f0d80994/jetified-firebase-sessions-1.0.2-api.jar!/META-INF/com.google.firebase-firebase-sessions.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.4.2. e: C:/Users/bpbuild/.gradle/caches/transforms-2/files-2.1/79bf8eaee136af22f96187e860727684/jetified-kotlinx-coroutines-play-services-1.6.4.jar!/META-INF/kotlinx-coroutines-play-services.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.2. e: C:/Users/bpbuild/.gradle/caches/transforms-2/files-2.1/8df95c2cfe5c084eff52d1efd5ce6065/jetified-kotlin-stdlib-jdk7-1.7.10.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.4.2. e: C:/Users/bpbuild/.gradle/caches/transforms-2/files-2.1/b30a90b1a7168542ebcb25dc175bf446/jetified-firebase-encoders-json-18.0.1-api.jar!/META-INF/com.google.firebase-encoders-firebase-encoders-json.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.4.2. e: C:/Users/bpbuild/.gradle/caches/transforms-2/files-2.1/dd44a9797daa2b933e8e7003cac2d6eb/jetified-kotlin-stdlib-jdk8-1.7.10.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.4.2. e: D:\api34fuck(2021.3.40f1)\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\java\com\bega\resolution\Resolution.kt: (16, 2): Class 'kotlin.Suppress' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.4.2. The class is loaded from C:/Users/bpbuild/.gradle/caches/transforms-2/files-2.1/0462de0991e1719bb7d18e3b0b4e2e05/jetified-kotlin-stdlib-1.7.10.jar!/kotlin/Suppress.class e: D:\api34fuck(2021.3.40f1)\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\java\com\bega\resolution\Resolution.kt: (23, 80): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.4.2. The class is loaded from C:/Users/bpbuild/.gradle/caches/transforms-2/files-2.1/0462de0991e1719bb7d18e3b0b4e2e05/jetified-kotlin-stdlib-1.7.10.jar!/kotlin/Unit.class FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':unityLibrary:compileDebugKotlin'. > Compilation error. See log for more details * 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 BUILD FAILED in 12s Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 UnityEditor.BuildPipeline:BuildPlayer (UnityEditor.BuildPlayerOptions) XBuilder:BuildIng () (at Assets/Scripts/Editor/XBuilder.cs:633) XBuilder:Build () (at Assets/Scripts/Editor/XBuilder.cs:359) | cs |
이번엔 아예 빌드가 되지 않는다. 또 다시 검색 시작 ...
가변 해상도 대응을 위해 안드로이드의 해상도를 가져오는 플러그인을
Kotlin source plugin으로 사용하고 있는게 문제였다.
5. Dependency Hell~~~~.
AGP(Android Gradle Plugin) - Gradle - Java - Kotlin Plugin - Kotlin ...
이쯤되면 포기하고 싶다.
위 어느 것 하나 제대로 알고 있는 게 없다.
검색 결과를 보면 대충 3 가지로 요약된다.
1. Unity 최신 버전을 사용해라.
2. Android Studio로 내보내기 해서 버전을 잘 맞춰서 거기서 빌드해라.
3. 플러그인이 진짜로 필요한지 확인하고 없애라.
6. Kotlin to Java.
위에 적었듯이 어느 하나 전문적이지 않은 나로서는 2번은 선택하기 어렵다.
마찬가지로 1번은 Unity 메이저 버전이 바뀌기 때문에 부담스럽다.
그래서, 3번을 최종적으로 고려하고 있을 때 문득 떠오른 생각.
의존성 지옥에서 Kotlin 이라도 제거한다면, Java로 변경하면 어떨까?
7. codeium.
보통 Java to Kotlin 또는 Kotlin to Java를 검색하면 Android Studio를
사용하는 방법이 나온다. 하지만, 그건 역시 내가 Android Studio를 사용해야 한다.
그래서 생성형 AI에 요청해 봤다.
Eureka!
이래서 다들 생성형 AI 노래를 부르는 구나 싶었다.
이제 Kotlin source plugin을 Java source plugin으로 변경하고 빌드해보자.
8. 결론.
급한 불은 끄게 되었다.
굳이 필요 없다면 플러그인 사용을 자제하는 게 맞지 않을까?
댓글 없음:
댓글 쓰기