Home > database >  Android app crashes with exception.class.missing._Unknown_
Android app crashes with exception.class.missing._Unknown_

Time:11-10

I’ve just released the latest version of my app but I'm seeing this crash in the Google Play Console for some users.

exception.class.missing._Unknown_: 
  at com.android.icu.util.regex.PatternNative.compileImpl (Native Method)
  at com.android.icu.util.regex.PatternNative.<init> (PatternNative.java:39)
  at com.android.icu.util.regex.PatternNative.create (PatternNative.java:35)
  at java.util.regex.Pattern.compile (Pattern.java:1426)
  at java.util.regex.Pattern.<init> (Pattern.java:1401)
  at java.util.regex.Pattern.compile (Pattern.java:959)
  at com.mymedia.android.tracker.custom.MyInputFilter.<init> (MyInputFilter.java:30)

Is this saying that it can't find the native class / method com.android.icu.util.regex.PatternNative.compileImpl()? Or is it my class MyInputFilter?

A couple of things that I've done differently for this new release which I'm wondering could have caused this.

  1. I've released an App Bundle instead of an APK.
  2. I've added these Proguard / shrinking & obfusication settings in build.gradle.
buildTypes {
    release {
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        debuggable false
    }
}

I've looked in the Proguard build output file usage.txt but I don't see any mention of PatternNative being removed or anything that might cause this.

CodePudding user response:

Have you tried to update your dependencies?

CodePudding user response:

Your problem is probably obfuscation of your regex in the MyInputFilter.java:30. Try prevent obfuscation on your class fields by adding these lines to your proguard-rules.pro file:

-keepclassmembers class com.mymedia.android.tracker.custom.MyInputFilter {
    *;
}
  • Related