365連休

にわかのandroidとかの開発メモ。

【解決】 Android Studio Arctic Fox 特定の端末でストアからインストールした時のみ、必ずクラッシュし起動できない。

build.gradle

  • AdMob SDK 20.2.0 (com.google.android.gms:play-services-ads:20.2.0)
  • User Messaging Platform SDK 2.0.0 (com.google.android.ump:user-messaging-platform:2.0.0)
  • minifyEnabled true
  • shrinkResources true
  • compileSdkVersion 30
  • minSdkVersion 16
  • targetSdkVersion 30

 

事案

特定の端末でストアからインストールした時のみ、必ずjava.lang.VerifyErrorが発生する。

 

java.lang.VerifyError: 
  at ???.library.android.ad.ConsentUtil.getInstance (ConsentUtil.java)
  at ???.library.android.ad.????????Activity.onCreate (????????Activity.java)
  at ???.library.android.ad.?????????Activity.onCreate (?????????Activity.java)
  at androidx.activity.ComponentActivity.activateLogFile (ComponentActivity.java)
  or                     .bind (ComponentActivity.java)
  or                     .e (ComponentActivity.java)
  or                     .getLifecycle (ComponentActivity.java)
  or                     .getLive (ComponentActivity.java)
  or                     .inflate (ComponentActivity.java)
  or                     .isActivatedLogFile (ComponentActivity.java)
  or                     .onCreate (ComponentActivity.java)
  at android.app.Activity.performCreate (Activity.java:6759)
  at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1119)
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2618)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2726)
  at android.app.ActivityThread.-wrap12 (ActivityThread.java)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1477)
  at android.os.Handler.dispatchMessage (Handler.java:102)
  at android.os.Looper.loop (Looper.java:159)
  at android.app.ActivityThread.main (ActivityThread.java:6139)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:886)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:776)

 

解決

VerifyErrorはライブラリ間のimplementationの齟齬の可能性があるとの情報を見かけたが、クラッシュする端末とそうでない端末があるため原因から除外。

 

UMP SDKを1.0.0から2.0.0へ切り替えた直後であること、

Consent関係の自作ライブラリで落ちている事から、

UMP SDKに関係していると推察。

 

 そこでググってみると、

stackoverflow.com

 

どうやら、UMP SDK 2.0.0ProguardEU圏端末が組み合わさった時に発生するらしい。

ちなみに今回のクラッシュ端末はEU圏とかではなく普通に日本で使っている端末だった。

 

UMP SDK 1.0.0と2.0.0の違いは、

2.0.0 2021‑07‑12 Removed the ConsentInformation.ConsentType IntDef and the ConsentInformation.getConsentType() method.

これだけらしい。

 

公式からProguard対応がなされるまでの暫定措置として、

UMP SDKを2.0.0から1.0.0へ戻すことにより、無事クラッシュすることは無くなった。

 

以上。