I Uploaded aab to playstore and when downloaded to devices i get ANR and black screens ..

logs from crashlytics

Unable to destroy activity {com./com..MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.lifecycle.d.c(androidx.lifecycle.f)' on a null object reference Fatal Exception: java.lang.RuntimeException: Unable to destroy activity {com.../com....MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.lifecycle.d.c(androidx.lifecycle.f)' on a null object reference at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5567) at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5597) at android.app.servertransaction.DestroyActivityItem.execute(DestroyActivityItem.java:44) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:190) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:105) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2386) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:213) at android.app.ActivityThread.main(ActivityThread.java:8178) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)

//

Caused by java.lang.NullPointerException Attempt to invoke virtual method 'void androidx.lifecycle.d.c(androidx.lifecycle.f)' on a null object reference

Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.lifecycle.d.c(androidx.lifecycle.f)' on a null object reference at com.mr.flutter.plugin.filepicker.FilePickerPlugin.tearDown(FilePickerPlugin.java:21) at com.mr.flutter.plugin.filepicker.FilePickerPlugin.onDetachedFromActivity(FilePickerPlugin.java) at io.flutter.embedding.engine.FlutterEnginePluginRegistry.detachFromActivity(FlutterEnginePluginRegistry.java:52) at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onDetach(FlutterActivityAndFragmentDelegate.java:58) at io.flutter.embedding.android.FlutterActivity.onDestroy(FlutterActivity.java:10)

firebase

com.google.firebase.crashlytics.startup1 at sun.misc.Unsafe.park(Unsafe.java) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2067) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at com.google.firebase.crashlytics.internal.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:2) at com.google.firebase.crashlytics.internal.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:5) at java.lang.Thread.run(Thread.java:929)

pubscpec.yaml

  firebase_core: ^0.7.0
  # Newly reworked plugins covered by this migration guide:
  firebase_auth: ^0.20.0+1
  firebase_crashlytics: ^0.4.0+1
  cloud_firestore: ^0.16.0
  cloud_functions: ^0.9.0
  firebase_storage: ^7.0.0
  firebase_messaging: ^8.0.0-dev.14
  firebase_remote_config: ^0.6.0
  # Updated to work with new core only plugins (no new changes):

  firebase_analytics: "^7.0.1"
  firebase_database: "^6.0.0"
  firebase_in_app_messaging: "^0.3.0+1"
  firebase_performance: "^0.5.0+1"

  file_picker: ^2.1.6

on running flutter build apk / flutter build app-bundle it builds

on runnign flutter build apk --split-per-abi

              - Required org.gradle.usage 'java-api' and found compatible value 'java-runtime'.
              - Required org.jetbrains.kotlin.platform.type 'androidJvm' but no value provided.
      - Variant 'profileApiElements' capability io.flutter.plugins.firebase.crashlytics:firebase_crashlytics:1.0-SNAPSHOT:
          - Incompatible attribute:                                 
              - Required com.android.build.api.attributes.BuildTypeAttr 'buildTypes' and found incompatible value 'profile'.
          - Other attributes:                                       
              - Found com.android.build.api.attributes.VariantAttr 'profile' but wasn't required.
              - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.


Solution 1: griffins

cant reproduce the error but there was something in the logs about not libapp.so error.

Fixed it by installing NDK(side by side) from android studio sdk manager