集结extras.gradle
buildscript { repositorIEs { mavenCentral() jcenter() } dependencIEs { classpath 'com.Google.gms:Google-services:3.0.0' }}apply plugin: 'com.Google.gms.Google-services'
尝试构建应用程序时出现以下错误:
* Where:Script 'platforms/androID/build-extras.gradle' line: 11* What went wrong:A problem occurred evaluating script.> Plugin with ID 'com.Google.gms.Google-services' not found.
我尝试使用< framework src =“src / androID / build-extras.gradle”custom =“true”type =“gradleReference”/>包括build-extras.gradle.并手动将其复制到平台/ androID.
科尔多瓦参考:
https://cordova.apache.org/docs/en/latest/guide/platforms/android/#extending-buildgradle
Google参考:
https://developers.google.com/identity/sign-in/android/start-integrating
如果我从build-extras.gradle中获取相同的代码并直接追加到build.gradle的末尾,它似乎可行.有关如何在build-extras.gradle文件中使用此功能的任何想法?
解决方法 你必须用你的build-extras.gradle包装ext.postBuildExtras = { //... your gradle supplement }
以下是build-extras.gradle文件的示例:
ext.postBuildExtras = { androID { packagingOptions { exclude 'meta-inf/DEPENDENCIES' exclude 'meta-inf/liCENSE' exclude 'meta-inf/liCENSE.txt' exclude 'meta-inf/license.txt' exclude 'meta-inf/NOTICE' exclude 'meta-inf/NOTICE.txt' exclude 'meta-inf/notice.txt' exclude 'meta-inf/ASL2.0' } } dependencIEs { compile files('libs/httpclIEnt-4.5.4.jar','libs/httpcore-4.4.7.jar') }}
并将其放在与build.gradle文件相同的文件夹下.
在Cordova AndroID v7.0.0之后,你应该这样放置它:
$PROJECT_PATH/platforms/androID/app/build.gradle$PROJECT_PATH/platforms/androID/app/build-extras.gradle总结
以上是内存溢出为你收集整理的扩展cordova gradle文件以包含谷歌服务全部内容,希望文章能够帮你解决扩展cordova gradle文件以包含谷歌服务所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)