标签: firebase-performance

com.google.android.gms.internal.firebase-perf.zza 中缺少方法

minifyEnabled true仅当我怀疑问题与 proguard 或 R8 有关时才会出现此错误”

\n\n

错误

\n\n
2019-08-22 18:26:05.320 8403-8403/com.xxxx.xxxx\nE/AndroidRuntime: FATAL EXCEPTION: main\n    Process: com.easyschool.easyschoolwebsite, PID: 8403\n    java.lang.ExceptionInInitializerError\n        at com.google.firebase.perf.provider.FirebasePerfProvider.<init>(com.google.firebase:firebase-perf@@19.0.0:2)\n        at java.lang.Class.newInstance(Native Method)\n        at android.app.AppComponentFactory.instantiateProvider(AppComponentFactory.java:121)\n        at androidx.core.app.CoreComponentFactory.instantiateProvider(CoreComponentFactory.java:60)\n        at android.app.ActivityThread.installProvider(ActivityThread.java:6405)\n        at android.app.ActivityThread.installContentProviders(ActivityThread.java:5963)\n        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5869)\n        at android.app.ActivityThread.access$1100(ActivityThread.java:200)\n        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1653)\n        at android.os.Handler.dispatchMessage(Handler.java:106)\n        at android.os.Looper.loop(Looper.java:193)\n        at android.app.ActivityThread.main(ActivityThread.java:6694)\n        at java.lang.reflect.Method.invoke(Native Method)\n        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)\n        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)\n     Caused by: java.lang.RuntimeException: Shaking error: Missing method in com.google.android.gms.internal.firebase-perf.zza: void <clinit>()\n        at com.google.android.gms.internal.firebase-perf.zza.<clinit>(Unknown Source:9)\n        at com.google.firebase.perf.provider.FirebasePerfProvider.<init>(com.google.firebase:firebase-perf@@19.0.0:2)\xc2\xa0\n        at java.lang.Class.newInstance(Native Method)\xc2\xa0\n        at android.app.AppComponentFactory.instantiateProvider(AppComponentFactory.java:121)\xc2\xa0\n        at androidx.core.app.CoreComponentFactory.instantiateProvider(CoreComponentFactory.java:60)\xc2\xa0\n        at android.app.ActivityThread.installProvider(ActivityThread.java:6405)\xc2\xa0\n        at android.app.ActivityThread.installContentProviders(ActivityThread.java:5963)\xc2\xa0\n …
Run Code Online (Sandbox Code Playgroud)

android proguard firebase google-play-services firebase-performance

3
推荐指数
1
解决办法
1363
查看次数

如何在 RxJava 2 自定义运算符的 onSubscribe 上获取 RetroFit 请求的 URL 和方法?

因此,我尝试集成 Http 请求的 Firebase 性能并手动添加它们,如此处所示步骤 9)。

我正在使用 Retrofit 2 和 RxJava 2,所以我想到了做一个自定义运算符,检查下面的代码:

改造 2 客户端

@GET("branch-{environment}/v2/branches")
    fun getBranch(@Path("environment") environment: String, @Query("location") location: String, @Query("fulfilment_type") fulfilmentType: String): Single<Response<GetBranchResponse>>
Run Code Online (Sandbox Code Playgroud)

RxJava 调用 Retrofit 客户端

private val client: BranchClient = clientFactory.create(urlProvider.apiUrl)

override fun getBranch(postCode: String, fulfilmentType: FulfilmentType): Single<GetBranchResponse> {
        return client
                .getBranch(environment, postCode.toUpperCase(), fulfilmentType.toString())
                .lift(RxHttpPerformanceSingleOperator(URL?, METHOD?))
                .map { it.body() }
                .subscribeIO() //custom Kotlin extension 
                .observeMain() //custom Kotlin extension 
                ...
    } 
Run Code Online (Sandbox Code Playgroud)

RxJava 2 自定义操作符通过 lift:

class RxHttpPerformanceSingleOperator<T>(private val url: String, private val method: …
Run Code Online (Sandbox Code Playgroud)

kotlin firebase retrofit2 rx-java2 firebase-performance

2
推荐指数
1
解决办法
1244
查看次数

Firebase 性能 - 向应用添加了 SDK,但控制台仍然说添加 SDK

https://firebase.google.com/docs/perf-mon/troubleshooting?authuser=0&platform=android#sdk-not-detected

我尝试了所有这些步骤,但似乎没有激活。

项目级 build.gradle:

dependencies {
    classpath 'com.android.tools.build:gradle:3.5.3'
    classpath 'com.google.gms:google-services:4.3.3'
    classpath 'com.google.firebase:perf-plugin:1.3.1' 
}
Run Code Online (Sandbox Code Playgroud)

应用级 build.gradle:

apply plugin: 'com.google.firebase.firebase-perf'

implementation 'com.google.firebase:firebase-perf:19.0.5'
Run Code Online (Sandbox Code Playgroud)

问题是什么?

我在日志中看到 2 行:

2020-02-19 23:13:41.574 20828-21030/com.sample.project I/FirebasePerformance: HTTP Method is null or invalid: <com.google.android.gms.internal.firebase-perf.zzcv$zzb@1144676 number=0 name=HTTP_METHOD_UNKNOWN>
2020-02-19 23:13:41.574 20828-21030/com.sample.project W/FirebasePerformance: Unable to process the PerfMetric due to missing or invalid values. See earlier log statements for additional information on the specific missing/invalid values.
Run Code Online (Sandbox Code Playgroud)

并且有完整的日志:

2020-02-19 23:13:22.514 20828-20828/com.sample.project D/FirebasePerformance: Config resolver result for flag: 'com.google.android.gms.internal.firebase-perf.zzav' is: '0.01'.
2020-02-19 23:13:22.515 20828-20828/com.sample.project …
Run Code Online (Sandbox Code Playgroud)

android firebase firebase-performance

2
推荐指数
1
解决办法
1809
查看次数

无法在 Android 上安装 Firebase Performance Monitoring SDK

我已经完成了这里提到的所有必要步骤https://firebase.google.com/docs/perf-mon/get-started-android之后,当我尝试构建项目时,它给了我这个错误

FirebasePerformancePlugin may only be applied to Android projects
Run Code Online (Sandbox Code Playgroud)

firebase firebase-performance

1
推荐指数
1
解决办法
2124
查看次数

Firebase 跟踪取消

我想使用 firebase 性能跟踪来测量我的应用程序中任务的时间;但是,我不想包括用户背景应用程序的时间。如果不再需要任务,我找不到取消任务的方法。

例如

  1. 我开始任务
  2. 用户背景应用
  3. 用户返回到应用程序
  4. 任务继续并完成

如何确保应用后台运行的时间不会影响我的指标?我认为扔掉这些样本会起作用,但没有取消方法。

android firebase firebase-performance

0
推荐指数
1
解决办法
414
查看次数