pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

安卓 |無法為 15.0.1 版添加所有 Google 庫

Android | Cannot add all Google libraries for version 15.0.1(安卓 |無法為 15.0.1 版添加所有 Google 庫)
本文介紹了安卓 |無法為 15.0.1 版添加所有 Google 庫的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我在做一些工作的同時(shí)學(xué)習(xí) Android.我正在嘗試將應(yīng)用的版本更新到 Android 8.0,其中包括使用的 sdk、庫和外部 API.

所以目前我正在使用版本 12.0.1 來提供播放服務(wù)和 firebase 服務(wù).像這樣使用它:

實(shí)現(xiàn) 'com.google.android.gms:play-services-maps:12.0.1'實(shí)施 'com.google.android.gms:play-services-analytics:12.0.1'實(shí)施 'com.google.android.gms:play-services-ads:12.0.1'實(shí)施 'com.google.android.gms:play-services-auth:12.0.1'實(shí)施 'com.google.android.gms:play-services-gcm:12.0.1'實(shí)施 'com.google.firebase:firebase-core:12.0.1'實(shí)施 'com.google.firebase:firebase-analytics:12.0.1'實(shí)施 'com.google.firebase:firebase-crash:12.0.1'實(shí)施 'com.google.firebase:firebase-messaging:12.0.1'實(shí)施 'com.android.support:support-v4:27.1.0'實(shí)施 'com.android.support:appcompat-v7:27.1.0'

但如果我嘗試僅使用 play-services 15.0.1 進(jìn)行分析,那么它會(huì)給我另一個(gè)警告,即使用不同版本的播放服務(wù)和 firebase 服務(wù)可能會(huì)導(dǎo)致運(yùn)行時(shí)崩潰.

所以這讓我處于一個(gè)奇怪的境地,我用谷歌搜索和搜索,但找不到任何適合我的東西......在這里處理這個(gè)問題的正確方法是什么?我應(yīng)該滿足于 12.0.1 嗎?或更新曾經(jīng)有效的方法?(以前版本是 9.4.0 或類似的版本;在我進(jìn)行 Android 8.0 升級之前)

這些是我的頂級 gradle 依賴項(xiàng)

類路徑 'com.android.tools.build:gradle:3.1.3'類路徑 'com.google.gms:google-services:4.0.2'

解決方案

您不能將小于或等于 12 的 firebase 和 google play 服務(wù)版本與大于或等于 15 的版本混合使用.

因此您需要更新所有這些庫的版本號:

實(shí)施 'com.google.android.gms:play-services-maps:15.0.1'實(shí)施 'com.google.android.gms:play-services-analytics:15.0.1'實(shí)施 'com.google.android.gms:play-services-ads:15.0.1'實(shí)施 'com.google.android.gms:play-services-auth:15.0.1'實(shí)施 'com.google.android.gms:play-services-gcm:15.0.1'實(shí)施 'com.google.firebase:firebase-core:16.0.1'實(shí)施 'com.google.firebase:firebase-analytics:16.0.1'實(shí)施 'com.google.firebase:firebase-crash:16.0.1'實(shí)施 'com.google.firebase:firebase-messaging:17.1.0'

檢查一下:

https://firebase.google.com/support/release-notes/android

https://android-developers.googleblog.com/2018/05/announcing-new-sdk-versioning.html

<塊引用>

從版本 15 開始,每個(gè)匹配 com.google.android.gms:play-services-*com.google.firebase:firebase-* 的 Maven 依賴項(xiàng)是不再需要具有相同的版本號才能在構(gòu)建時(shí)和運(yùn)行時(shí)正常工作.

還可以在頂級 gradle 文件中使用以下 google play services 插件:

 類路徑 'com.google.gms:google-services:4.0.1'

i'm learning Android while doing some work on it. I'm trying to update an app's version to Android 8.0, that includes sdk, libraries and external APIs used.

I looked it up and it seems like 15.0.1 is the suggested version. But when i use it, gradle fails for play-services-analytics and firebase services to sync saying it cannot resolve the library and nor can it find the Repository if i press Install Repository.

So currently i'm using version 12.0.1 for both play services and firebase services. Using it like:

implementation 'com.google.android.gms:play-services-maps:12.0.1'
implementation 'com.google.android.gms:play-services-analytics:12.0.1'
implementation 'com.google.android.gms:play-services-ads:12.0.1'
implementation 'com.google.android.gms:play-services-auth:12.0.1'
implementation 'com.google.android.gms:play-services-gcm:12.0.1'
implementation 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.google.firebase:firebase-analytics:12.0.1'
implementation 'com.google.firebase:firebase-crash:12.0.1'
implementation 'com.google.firebase:firebase-messaging:12.0.1'
implementation 'com.android.support:support-v4:27.1.0'
implementation 'com.android.support:appcompat-v7:27.1.0'

But if i try to use only the play-services 15.0.1 except for analytics then it gives me another warning that using different versions of play services and firebase services can lead to runtime crashes.

So it puts me in a weird situation, i've googled and searched, but cant find anything that works for me... What would be the correct way to deal with this here? Should i settle for 12.0.1? or update what ever works? (Previously the version was 9.4.0 or something along that line; before i was doing the Android 8.0 upgrade)

EDIT: These are my top level gradle dependencies

classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.2'

解決方案

You cannot mix versions of firebase and google play services that are less than or equal to 12 with versions that are greater than or equal to 15.

Therefore you need to update the version number of all these libraries:

implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-analytics:15.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-analytics:16.0.1'
implementation 'com.google.firebase:firebase-crash:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'

Check this:

https://firebase.google.com/support/release-notes/android

https://android-developers.googleblog.com/2018/05/announcing-new-sdk-versioning.html

Beginning with version 15, each Maven dependency matching com.google.android.gms:play-services-* and com.google.firebase:firebase-* is no longer required to have the same version number in order to work correctly at build time and at run time.

Also use the following google play services plugin in the top level gradle file:

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

這篇關(guān)于安卓 |無法為 15.0.1 版添加所有 Google 庫的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

IncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM(更新到 Android Build Tools 25.1.6 GCM/FCM 后出現(xiàn) IncompatibleClassChangeError)
How to get current flavor in gradle(如何在 gradle 中獲取當(dāng)前風(fēng)味)
How to fix quot;unexpected element lt;queriesgt; found in lt;manifestgt;quot; error?(如何修復(fù)“意外元素lt;查詢gt;在“清單中找到錯(cuò)誤?)
Multi flavor app based on multi flavor library in Android Gradle(基于 Android Gradle 中多風(fēng)味庫的多風(fēng)味應(yīng)用)
Android dependency has different version for the compile and runtime(Android 依賴在編譯和運(yùn)行時(shí)有不同的版本)
Transitive dependencies for local aar library(本地 aar 庫的傳遞依賴)
主站蜘蛛池模板: 济南冷库安装-山东冷库设计|建造|冷库维修-山东齐雪制冷设备有限公司 | 四川成人高考_四川成考报名网 | 挤奶设备过滤纸,牛奶过滤纸,挤奶机过滤袋-济南蓝贝尔工贸有限公司 | 杭州网络公司_百度SEO优化-外贸网络推广_抖音小程序开发-杭州乐软科技有限公司 | 广东恩亿梯电源有限公司【官网】_UPS不间断电源|EPS应急电源|模块化机房|电动汽车充电桩_UPS电源厂家(恩亿梯UPS电源,UPS不间断电源,不间断电源UPS) | 常州企业采购平台_常州MRO采购公司_常州米孚机电设备有限公司 | 房车价格_依维柯/大通/东风御风/福特全顺/江铃图片_云梯搬家车厂家-程力专用汽车股份有限公司 | 石油/泥浆/不锈钢防腐/砂泵/抽砂泵/砂砾泵/吸砂泵/压滤机泵 - 专业石油环保专用泵厂家 | 热处理炉-退火炉-回火炉设备厂家-丹阳市电炉厂有限公司 | 卡诺亚轻高定官网_卧室系统_整家定制_定制家居_高端定制_全屋定制加盟_定制家具加盟_定制衣柜加盟 | 钢衬四氟管道_钢衬四氟直管_聚四氟乙烯衬里管件_聚四氟乙烯衬里管道-沧州汇霖管道科技有限公司 | 工业冷却塔维修厂家_方形不锈钢工业凉水塔维修改造方案-广东康明节能空调有限公司 | EPK超声波测厚仪,德国EPK测厚仪维修-上海树信仪器仪表有限公司 | 陕西安玻璃自动感应门-自动重叠门-磁悬浮平开门厂家【捷申达门业】 | 丹佛斯压力传感器,WISE温度传感器,WISE压力开关,丹佛斯温度开关-上海力笙工业设备有限公司 | 透平油真空滤油机-变压器油板框滤油机-滤油车-华之源过滤设备 | 网站优化公司_北京网站优化_抖音短视频代运营_抖音关键词seo优化排名-通则达网络 | 锂离子电池厂家-山东中信迪生电源 | 焊接减速机箱体,减速机箱体加工-淄博博山泽坤机械厂 | 电伴热系统施工_仪表电伴热保温箱厂家_沃安电伴热管缆工业技术(济南)有限公司 | 开云(中国)Kaiyun·官方网站 - 登录入口 | 冷油器-冷油器换管改造-连云港灵动列管式冷油器生产厂家 | 阀门智能定位器_电液动执行器_气动执行机构-赫尔法流体技术(北京)有限公司 | 铝机箱_铝外壳加工_铝外壳厂家_CNC散热器加工-惠州市铂源五金制品有限公司 | 北京模型公司-军事模型-工业模型制作-北京百艺模型沙盘公司 | 欧版反击式破碎机-欧版反击破-矿山石料破碎生产线-青州奥凯诺机械 | GEDORE扭力螺丝刀-GORDON防静电刷-CHEMTRONICS吸锡线-上海卓君电子有限公司 | 同学聚会纪念册制作_毕业相册制作-成都顺时针宣传画册设计公司 | 污泥烘干机-低温干化机-工业污泥烘干设备厂家-焦作市真节能环保设备科技有限公司 | 杭州成人高考_浙江省成人高考网上报名| 锂电叉车,电动叉车_厂家-山东博峻智能科技有限公司 | 大型多片锯,圆木多片锯,方木多片锯,板材多片锯-祥富机械有限公司 | 高清视频编码器,4K音视频编解码器,直播编码器,流媒体服务器,深圳海威视讯技术有限公司 | 东莞精密模具加工,精密连接器模具零件,自動機零件,冶工具加工-益久精密 | 辐射仪|辐射检测仪|辐射巡测仪|个人剂量报警仪|表面污染检测仪|辐射报警仪|辐射防护网 | 非标压力容器_碳钢储罐_不锈钢_搪玻璃反应釜厂家-山东首丰智能环保装备有限公司 | GAST/BRIWATEC/CINCINNATI/KARL-KLEIN/ZIEHL-ABEGG风机|亚喜科技 | SRRC认证_电磁兼容_EMC测试整改_FCC认证_SDOC认证-深圳市环测威检测技术有限公司 | 碎石机设备-欧版反击破-欧版颚式破碎机(站)厂家_山东奥凯诺机械 高低温试验箱-模拟高低温试验箱订制-北京普桑达仪器科技有限公司【官网】 | 安徽净化板_合肥岩棉板厂家_玻镁板厂家_安徽科艺美洁净科技有限公司 | 胀套-锁紧盘-风电锁紧盘-蛇形联轴器「厂家」-瑞安市宝德隆机械配件有限公司 |