我们从PGB集成插件“ cordova-plugin-firebase”收到此错误。
编辑
正在使用插件
call-number 0.0.2
cordova-plugin-splashscreen
cordova-plugin-ionic-keyboard
cordova-plugin-file 4.3.3
cordova-plugin-compat 1.2.0
cordova-plugin-device 1.1.7
ourprojectname-plugin-firebase 2.0.5
cordova-plugin-calendar 4.6.0
cordova-plugin-statusbar 2.4.2
cordova-plugin-whitelist 1.3.3
cordova-plugin-app-event 1.2.1
cordova-android-support-gradle-release
cordova-plugin-datepicker 0.9.3
cordova-plugin-actionsheet 2.3.3
cordova-plugin-app-version 0.1.9
cordova-plugin-inappbrowser 1.7.2
cordova-plugin-file-transfer 1.6.3
cordova-plugin-network-information 1.3.4
cordova-plugin-camera 2.4.1 >
cordova-plugin-media-capture 1.4.3
PGB配置
<engine name="ios" spec="4.5.4" />
<engine name="android" spec="6.3.0" />
<preference name="phonegap-version" value="cli-7.1.0" />
<preference name="pgb-builder-version" value="1" />
Cordova cli 7.1.0
Android Studio 3.0.1
FAILURE: Build failed with an exception.
* Where:
Script '/project/ourprojectname-plugin-firebase/ourprojectname-build.gradle' line: 28
* What went wrong:
A problem occurred evaluating root project 'project'.
> Plugin with id 'com.google.gms.google-services' not found.
插件已自定义,当前作为npm软件包推送。这是 build.gradle 文件
buildscript { repositories { jcenter() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:+' classpath 'com.google.gms:google-services:+' // Updated from 'com.google.gms:google-services:4.1.0' } } repositories { mavenCentral() maven { url "https://maven.google.com" } } dependencies { compile 'me.leolin:ShortcutBadger:1.1.4@aar' compile project(':CordovaLib') // Android studio project build requirement compile 'com.google.firebase:firebase-auth:+' compile('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') { transitive = true } } cdvPluginPostBuildExtras.add({ apply plugin: 'com.google.gms.google-services' apply plugin: 'io.fabric' })
由于Android Studio本地上的构建正确,因此类路径“ com.google.gms:google-services”已更新为“ +”。
问题
1)是否可以通过某种方式将自定义gradle配置传递给PGB?
2)如果不是,如何解决报告的错误?
编辑
关于第一个问题,我们发现了 app-extras.gradle 方式可以覆盖或添加Android的某些配置,但这还不够。
当前成功构建android应用的唯一方法是使用以下建议:
https://stackoverflow.com/a/44364851/6859885
以及针对外部化插件的其他一些修补程序:
1)编译项目(':CordovaLib'),该项目可以修复有关cordova测试方法实现的问题;
2)在插件依赖项中添加 classpath'com.google.gms:google-services:+ ,以避免由于使用的插件之间的版本冲突而指定软件包版本。
谢谢。