安装 Firebase 时支持的最低 Gradle 版本错误
Minimum supported Gradle version error when installing Firebase
我正在尝试为我的应用程序发送推送通知。我从一个空白应用程序 (react-native init) 开始,然后安装 firebase,链接它,然后按照说明进行操作。首先,这里https://rnfirebase.io/docs/v5.x.x/installation/initial-setup
然后在这里 https://rnfirebase.io/docs/v5.x.x/installation/android
我在 build.gradle 中添加了所有必要的行,并将 gradle url 更改为 gradle-4.4-all.zip
但是当我尝试 运行 应用程序时,出现错误
Failed to apply plugin [id 'com.android.application']
Minimum supported Gradle version is 4.10.1. Current version is 4.4. If using the gradle wrapper, try editing the distributionUrl in /Users/irondsd/dev/RNFirebase/android/gradle/wrapper/gradle-wrapper.properties to gradle-4.10.1-all.zip
我试着重做两次,以确保我没有遗漏任何东西。但我每次都会遇到同样的错误。我尝试 google,但找不到太多。
这是我添加到项目级别的内容build.gradle
classpath 'com.google.gms:google-services:4.2.0'
classpath 'com.android.tools.build:gradle:3.3.2'
在 app/build.gradle:
implementation project(':react-native-firebase')
implementation "com.google.android.gms:play-services-base:16.1.0"
implementation "com.google.firebase:firebase-core:16.0.8"
// at the end of the file
apply plugin: 'com.google.gms.google-services'
这是react native版本和react-native-firebase版本
"react": "16.8.3",
"react-native": "0.59.4",
"react-native-firebase": "^5.3.0"
我做错了什么吗?
转到 android/gradle/wrapper/gradle-wrapper.properties
并将 distributionUrl 更改为
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip
它会解决问题。
我正在尝试为我的应用程序发送推送通知。我从一个空白应用程序 (react-native init) 开始,然后安装 firebase,链接它,然后按照说明进行操作。首先,这里https://rnfirebase.io/docs/v5.x.x/installation/initial-setup 然后在这里 https://rnfirebase.io/docs/v5.x.x/installation/android 我在 build.gradle 中添加了所有必要的行,并将 gradle url 更改为 gradle-4.4-all.zip 但是当我尝试 运行 应用程序时,出现错误
Failed to apply plugin [id 'com.android.application']
Minimum supported Gradle version is 4.10.1. Current version is 4.4. If using the gradle wrapper, try editing the distributionUrl in /Users/irondsd/dev/RNFirebase/android/gradle/wrapper/gradle-wrapper.properties to gradle-4.10.1-all.zip
我试着重做两次,以确保我没有遗漏任何东西。但我每次都会遇到同样的错误。我尝试 google,但找不到太多。
这是我添加到项目级别的内容build.gradle
classpath 'com.google.gms:google-services:4.2.0'
classpath 'com.android.tools.build:gradle:3.3.2'
在 app/build.gradle:
implementation project(':react-native-firebase')
implementation "com.google.android.gms:play-services-base:16.1.0"
implementation "com.google.firebase:firebase-core:16.0.8"
// at the end of the file
apply plugin: 'com.google.gms.google-services'
这是react native版本和react-native-firebase版本
"react": "16.8.3",
"react-native": "0.59.4",
"react-native-firebase": "^5.3.0"
我做错了什么吗?
转到 android/gradle/wrapper/gradle-wrapper.properties
并将 distributionUrl 更改为
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip
它会解决问题。