Can';t在Android上安装Firebase性能监控SDK

Can';t在Android上安装Firebase性能监控SDK,firebase,firebase-performance,Firebase,Firebase Performance,我已经完成了这里提到的所有必要步骤,之后当我尝试构建项目时,它会给我这个错误 FirebasePerformancePlugin may only be applied to Android projects 从错误中可以看出,“应用插件:'com.google.firebase.firebase perf'”已添加到项目的build.gradle中。它需要进入应用程序的build.gradle,就在“apply plugin:'com.android.application'”行之后,从错误

我已经完成了这里提到的所有必要步骤,之后当我尝试构建项目时,它会给我这个错误

FirebasePerformancePlugin may only be applied to Android projects

从错误中可以看出,“应用插件:'com.google.firebase.firebase perf'”已添加到项目的build.gradle中。它需要进入应用程序的build.gradle,就在“apply plugin:'com.android.application'”行之后,从错误中可以看出“apply plugin:'com.google.firebase.firebase perf'”已经添加到项目的build.gradle中。它需要进入应用程序的build.gradle,就在“apply plugin:'com.android.application'行”之后,你能看一下吗

相关build.gradle文件:

你能看一下吗

相关build.gradle文件:


以下是我在实现它时发现的内容

如果您使用的是Android studio 3.0,那么它已经更改了包含依赖项的语法,因此之前我们使用
compile
关键字包含库依赖项,并将其替换为
implementation

现在,如果您在项目级build.gradle中使用的Firebase插件版本低于1.1.3

classpath "com.google.firebase:firebase-plugins:1.1.2"
和应用程序级构建

implementation 'com.google.firebase:firebase-perf:11.4.2'
如果你这样做了,那么它会给你错误的说法

要使用Firebase性能插件,必须将Firebase性能监控SDK添加到应用程序的build.gradle中。请将compile'com.google.firebase:firebase perf:VERSION_NUMBER_-THAN_或_-EQUAL_-TO_11.0.4'添加到应用程序的build.gradle中

如以下Firebase插件版本所示,1.1.3Firebase专门在应用程序级别build.gradle中查找
compile
关键字

你可以用两种方法解决这个问题

1> 将单词
implementation
更改为
compile

2> 将firebase插件升级到
1.1.3
或更高版本


希望这对其他人也有帮助。:)

下面是我在实现它时发现的内容

如果您使用的是Android studio 3.0,那么它已经更改了包含依赖项的语法,因此之前我们使用
compile
关键字包含库依赖项,并将其替换为
implementation

现在,如果您在项目级build.gradle中使用的Firebase插件版本低于1.1.3

classpath "com.google.firebase:firebase-plugins:1.1.2"
和应用程序级构建

implementation 'com.google.firebase:firebase-perf:11.4.2'
如果你这样做了,那么它会给你错误的说法

要使用Firebase性能插件,必须将Firebase性能监控SDK添加到应用程序的build.gradle中。请将compile'com.google.firebase:firebase perf:VERSION_NUMBER_-THAN_或_-EQUAL_-TO_11.0.4'添加到应用程序的build.gradle中

如以下Firebase插件版本所示,1.1.3Firebase专门在应用程序级别build.gradle中查找
compile
关键字

你可以用两种方法解决这个问题

1> 将单词
implementation
更改为
compile

2> 将firebase插件升级到
1.1.3
或更高版本


希望这对其他人也有帮助。:)

如果有人将
apply插件:'com.google.firebase.firebase perf'
放在应用程序级别build.gralde中默认
apply插件:'com.android.application'
之前(或以上),gradle将抛出相同的错误消息。因此,保持文档中的顺序很重要。

如果有人将
应用插件'com.google.firebase.firebase perf'
放在应用程序级build.gralde中默认
应用插件'com.android.application'
之前(或以上),gradle将抛出相同的错误消息。因此,重要的是保持订单记录在案。

Hi 1HaKr。你能更具体地说明你所采取的步骤吗?:)你能到达第八步吗?你使用的是什么版本的Android Studio?这是一个简单的空应用程序吗?任何其他详细信息都会有所帮助。:)你好,哈克。你能更具体地说明你所采取的步骤吗?:)你能到达第八步吗?你使用的是什么版本的Android Studio?这是一个简单的空应用程序吗?任何其他详细信息都会有所帮助。:)