gpt4 book ai didi

android - java.lang.NoSuchMethodError : No static method registerDefaultInstance with Firebase Performance and Espresso Instrumented Tests

转载 作者:行者123 更新时间:2023-12-04 12:14:00 24 4
gpt4 key购买 nike

当我添加 implementation 'com.google.firebase:firebase-perf-ktx:19.1.0'我无法启动 espresso 仪器测试(“应用程序”方案构建正常)。当我尝试开始 Espresso 测试时,我有

Test running failed: Process crashed.
java.lang.NoSuchMethodError: No static method registerDefaultInstance(Ljava/lang/Class;Lcom/google/protobuf/GeneratedMessageLite;)V in class Lcom/google/protobuf/GeneratedMessageLite
但如果我要删除 implementation 'com.google.firebase:firebase-perf-ktx:19.1.0'一切正常。
如何保留 Firebase 性能库和 Espresso Instrumented 测试?

最佳答案

就我而言,这似乎是由 protobuf-lite:3.0.1 引起的最近更新的依赖 androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.4.0'我可以用这个排除来修复

androidTestImplementation (androidx.test.espresso:espresso-contrib:3.4.0'){
exclude module: "protobuf-lite"
}
如果是 KTX
testImplementation('androidx.test.espresso:espresso-contrib:3.4.0') {
exclude(module = "protobuf-lite")
}

关于android - java.lang.NoSuchMethodError : No static method registerDefaultInstance with Firebase Performance and Espresso Instrumented Tests,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66154727/

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