firebase playstore崩溃和ANR中的java.lang.RuntimeException

ctrmrzij  于 2023-01-14  发布在  Java
关注(0)|答案(1)|浏览(145)

这可能是一个重复,但我没有找到任何帖子的解决方案.我的flutter应用程序冻结在启动画面当安装从playstore,它不去过去的启动画面.但当我手动安装APK,它工作正常.
来自Playstore控制台的崩溃和ANR**消息如下

Exception java.lang.RuntimeException:
  at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4918)
  at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:4955)
  at android.app.servertransaction.ResumeActivityItem.execute (ResumeActivityItem.java:52)
  at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2336)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:246)
  at android.app.ActivityThread.main (ActivityThread.java:8653)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:602)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1130)
Caused by java.lang.IllegalStateException:
  at com.google.firebase.FirebaseApp.getInstance (FirebaseApp.java)
  at com.google.firebase.dynamiclinks.FirebaseDynamicLinks.getInstance (FirebaseDynamicLinks.java)
  at io.flutter.plugins.firebase.dynamiclinks.FlutterFirebaseDynamicLinksPlugin.getDynamicLinkInstance (FlutterFirebaseDynamicLinksPlugin.java)
  at io.flutter.plugins.firebase.dynamiclinks.FlutterFirebaseDynamicLinksPlugin.onNewIntent (FlutterFirebaseDynamicLinksPlugin.java)
  at io.flutter.embedding.engine.FlutterEngineConnectionRegistry$FlutterEngineActivityPluginBinding.onNewIntent (FlutterEngineConnectionRegistry.java)
  at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.onNewIntent (FlutterEngineConnectionRegistry.java)
  at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onNewIntent (FlutterActivityAndFragmentDelegate.java)
  at io.flutter.embedding.android.FlutterActivity.onNewIntent (FlutterActivity.java)
  at android.app.Activity.performNewIntent (Activity.java:8222)
  at android.app.Instrumentation.callActivityOnNewIntent (Instrumentation.java:1409)
  at android.app.Instrumentation.callActivityOnNewIntent (Instrumentation.java:1422)
  at android.app.ActivityThread.deliverNewIntents (ActivityThread.java:4085)
  at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4901)
    • 在不调试的情况下运行时,**我在终端中得到以下消息
  • 注意:C:\flutter.pub-cache\hosted\pub.dartlang.org\firebase_dynamic_links-5.0.11\android\src\main\java\io\flutter\plugins\firebase\dynamiclinks\FlutterFirebaseDynamicLinksPlugin.java使用未经检查或不安全的操作。使用-Xlint:取消选中重新编译以获取详细信息。某些输入文件使用或覆盖过时的API。使用-Xlint:deprecation重新编译以了解详细信息。C:\flutter.pub-cache\hosted\pub.dartlang.org\firebase_messaging-14.2.1\android\src\main\java\io\flutter\plugins\firebase\messaging\FlutterFirebaseMessagingPlugin.java使用未经检查或不安全的操作。使用-Xlint:取消选中重新编译以获取详细信息。某些输入文件使用或覆盖过时的API。使用-Xlint:deprecation重新编译以了解详细信息。*
    • 我还尝试删除**firebase动态链接:^5.0.11和firebase消息:^14.2.1插件完全,但应用程序仍然冻结在启动画面时,从playstore安装。
    • 这是我的build. gradle文件内容**
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new Exception("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"


def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}


android {
    compileSdkVersion 33
    ndkVersion flutter.ndkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.mosesbinzi.neba"
        // You can update the following values to match your application needs.
        // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
        minSdkVersion 21
        targetSdkVersion 33
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

   signingConfigs {
       release {
           keyAlias keystoreProperties['keyAlias']
           keyPassword keystoreProperties['keyPassword']
           storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
           storePassword keystoreProperties['storePassword']
       }
   }
   buildTypes {
       release {
           signingConfig signingConfigs.release
       }
   }

}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.google.android.gms:play-services-appset:16.0.2'
    implementation platform('com.google.firebase:firebase-bom:31.1.0')
    implementation 'com.google.firebase:firebase-auth'
    implementation 'com.google.firebase:firebase-messaging'
    implementation 'com.google.firebase:firebase-appcheck-playintegrity'
}`
ni65a41a

ni65a41a1#

在play.google.com/console中,选择你的应用程序...现在在左侧菜单中,进入设置,然后进入应用程序完整性。使链接成为包含所选应用程序的谷歌云项目。
这就是解决我问题的方法。

相关问题