android - 使用 firebase 和 google play service api 时 Ionic 应用程序崩溃

标签 android cordova firebase ionic-framework gradle

我在我的应用中使用了 firebase 和 google analytics 插件。

classpath 'com.google.gms:google-services:3.0.0 

使用此配置的应用程序在构建成功时崩溃/停止。 我尝试了另一种解决方案

与类路径 com.google.gms:google-services:+ 一起使用时 并在 build.gradle 文件中添加了一些更改

allprojects 
{ 

  maven{ 
    url 'https://maven.google.com'
  }

}

然后显示错误:Could not find method getCompileConfiguration() for arguments [] on object of type com.android.build.gradle.internal.api.ApplicationVariantImpl

最佳答案

Android 插件 3.0.0 需要 Gradle 版本 4.1 或更高版本。

如果您使用 Android Studio 3.0 或更高版本打开现有项目,请按照提示将现有项目自动更新为兼容的 Gradle 版本。

要手动更新 Gradle,请将 gradle-wrapper.properties 中的 URL 编辑为以下内容:

distributionUrl=\
  https\://services.gradle.org/distributions/gradle-4.4-all.zip

关于android - 使用 firebase 和 google play service api 时 Ionic 应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50173594/

相关文章:

android - 找不到提供商信息错误

ios - 已编译的 iOS Phonegap 应用程序在启动后未获取任何坐标

swift - 类型 "user?"没有成员 UID(Swift 3、Firebase)

java - 有没有办法可以将这些语句简化为几行代码?

android - Material 公开下拉菜单 OnItemSelectedListener 未被调用

android - 更改 RecyclerView 滚动条宽度

javascript - 未捕获的类型错误 : Cannot read property 'arc' of undefined

android - 如何更改 PushNotification 的消息内容?

javascript - 推送在 firebase 监听器内不起作用

Firebase 重置密码问题