gpt4 book ai didi

Android 8 或更高版本的应用程序在使用 Firebase Performance SDK 的 Android Oreo 上崩溃

转载 作者:行者123 更新时间:2023-11-29 02:23:18 34 4
gpt4 key购买 nike

我添加了最新的 Firebase Performance SDK,但在 Android 8(Oreo) 或更高版本中,应用崩溃并显示从未添加的错误消息 OnFrameMetricsAvailableListener。

应用级 build.gradle

    dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'com.google.firebase:firebase-plugins:1.1.5'
}

应用模块级 build.gradle

dependencies {

other
..............
..............

// Android support
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'

// Android Gms Play Services
implementation 'com.google.android.gms:play-services-gcm:16.0.0'

// Firebase
implementation 'com.google.firebase:firebase-perf:16.2.2'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'

日志

    Caused by: java.lang.IllegalArgumentException: attempt to remove OnFrameMetricsAvailableListener that was never added
at android.view.View.removeFrameMetricsListener(View.java:6862)
at android.view.Window.removeOnFrameMetricsAvailableListener(Window.java:890)
at android.support.v4.app.FrameMetricsAggregator$FrameMetricsApi24Impl.remove(FrameMetricsAggregator.java:436)
at android.support.v4.app.FrameMetricsAggregator.remove(FrameMetricsAggregator.java:246)
at com.google.firebase.perf.internal.zza.onActivityStopped(Unknown Source:64)
at android.app.Application.dispatchActivityStopped(Application.java:258)
at android.app.Activity.onStop(Activity.java:1950)
at android.support.v4.app.FragmentActivity.onStop(FragmentActivity.java:636)
at android.support.v7.app.AppCompatActivity.onStop(AppCompatActivity.java:184)
at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1382)
at android.app.Activity.performStop(Activity.java:7526)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4591)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4652) 
at android.app.ActivityThread.-wrap5(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1784) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:7002) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408) 

最佳答案

您需要将 perf 的版本从 16 降级到 15。这个问题可能会在即将推出的新版本中得到解决。

implementation 'com.google.firebase:firebase-perf:15.+'

或者您可以从 AndroidMainfest.xml 中删除 android:hardwareAccelerated="true"

关于Android 8 或更高版本的应用程序在使用 Firebase Performance SDK 的 Android Oreo 上崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53801735/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com