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

Fatal Exception: java.lang.NoSuchMethodError #47

Open
offline-first opened this issue Jul 6, 2022 · 5 comments
Open

Fatal Exception: java.lang.NoSuchMethodError #47

offline-first opened this issue Jul 6, 2022 · 5 comments

Comments

@offline-first
Copy link

Firebase crash log:

Fatal Exception: java.lang.NoSuchMethodError: No static method f(Landroid/content/Context;)Landroidx/core/app/n; in class Landroidx/core/app/n; or its super classes (declaration of 'androidx.core.app.n' appears in /data/app/~~S_zz7RiRmvHW3bspwnclbg==/androidx.test.tools.crawler-6DMZwvhRTKfw6HiB15rVYA==/base.apk)
       at com.vanethos.notification_permissions.MethodCallHandlerImpl.getNotificationPermissionStatus(MethodCallHandlerImpl.java:2)
       at com.vanethos.notification_permissions.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.java:10)
       at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:17)
       at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:18)
       at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0(DartMessenger.java:20)
       at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$DartMessenger(DartMessenger.java)
       at io.flutter.embedding.engine.dart.-$$Lambda$DartMessenger$TsixYUB5E6FpKhMtCSQVHKE89gQ.run(-.java:12)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at androidx.test.espresso.base.Interrogator.loopAndInterrogate(Interrogator.java:10)
       at androidx.test.espresso.base.UiControllerImpl.loopUntil(UiControllerImpl.java:7)
       at androidx.test.espresso.base.UiControllerImpl.loopMainThreadUntilIdle(UiControllerImpl.java:16)
       at androidx.test.espresso.ViewInteraction.doPerform(ViewInteraction.java:3)
       at androidx.test.espresso.ViewInteraction.-$$Nest$mdoPerform(ViewInteraction.java)
       at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:6)
       at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:1)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:201)
       at android.os.Looper.loop(Looper.java:288)
       at android.app.ActivityThread.main(ActivityThread.java:7839)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

obfuscation issue?

@roblframpton
Copy link

roblframpton commented Jul 6, 2022

I'm also getting this, I'm running integration tests via Firebase Test Lab and all devices are triggering this exception, all different manufacturers - Google, Samsung, Huawei, etc. It happens on all Android versions I tested (8 to 12). Although, it doesn't appear to fully crash the app.

EDIT: Actually, it's not my Test Lab tests. It's caused by the automated checks run automatically by Google Play when you upload a release.

@offline-first
Copy link
Author

Unfortunately, the proguard rule did not help either.
-keep class com.vanethos.notification_permissions.** { *; }
Does anyone have an idea?

@roblframpton
Copy link

@offline-first Are you able to reproduce this on an actual device? What device/android version/flutter version are you using? And does it actually crash or just appear in Crashlytics?

I can't reproduce on my device or an emulator, I only see it when triggered by Google Play's pre-release checks.

@roblframpton
Copy link

I believe I have resolved this. It is a ProGuard issue, but it's not a class in this package which can't be found but the NotificationManagerCompat class, called on line 73. I added the following to my ProGuard file:

-keep, includedescriptorclasses class androidx.core.app.NotificationManagerCompat { *; }

@Vanethos I'm not sure if this is a general issue or if both of us are doing something unusual, but would this be worth adding a note to the README? I'm happy to make a PR.

Incidentally, after fixing this I had a similiar issue in a different package (flutter_local_notifications) which couldn't find a static method on AlarmManagerCompat. Not quite sure why this is suddenly happenning, I don't think I'm doing anything different to other people.

@offline-first
Copy link
Author

No, I can't reproduce on my test devices. Just deploy to internal testing and wait a minute. Crashlytics show this error on the latest release version:

No static method f(Landroid/content/Context;)Landroidx/core/app/n; in class Landroidx/core/app/n; or its super classes (declaration of 'androidx.core.app.n' appears in /data/app/androidx.test.tools.crawler-IVtyR81jDnCTtKgIoHUHkA==/base.apk)

My last try with this proguard rule have also no effect:

-keep class androidx.core.app.** { *; }
-keep interface androidx.core.app.** { *; }

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