原生脚本 |无法运行安卓应用:请通过更新谷歌服务插件的版本来解决版本冲突



无法使用 NativeScript 命令构建和运行 Android 应用程序:

tns run android

我在控制台中收到此错误:

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.4.0.

我尝试从项目中删除Android平台,然后再次添加它,但它不起作用。

如何更新谷歌服务插件? 我的app.gradle文件中没有任何依赖项。

这是我的app.gradle文件:

// Add your native dependencies here:
// Uncomment to add recyclerview-v7 dependency
//dependencies {
//  compile 'com.android.support:recyclerview-v7:+'
//}
android {
  defaultConfig {
    generatedDensities = []
    applicationId = "com.grizlizli.app"
  }
  aaptOptions {
    additionalParameters "--no-version-vectors"
  }
}
def settingsGradlePath
if(project.hasProperty("appResourcesPath")){
    settingsGradlePath = "$project.appResourcesPath/Android/settings.gradle";
} else {
    settingsGradlePath = "$rootDir/../../app/App_Resources/Android/settings.gradle";
}
def settingsGradleFile = new File(settingsGradlePath);
if(settingsGradleFile.exists())
{
    apply from: settingsGradleFile;
}

设法通过更新本机脚本依赖项和删除本机脚本推送通知依赖项来解决此问题。

最新更新