首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >当我尝试添加Google服务地图功能时,Android给了我一个错误

当我尝试添加Google服务地图功能时,Android给了我一个错误
EN

Stack Overflow用户
提问于 2018-04-19 19:47:45
回答 1查看 53关注 0票数 0

对于我对这个项目的依赖,我一直有很多问题。我试图将Google添加到我的应用程序中,但当我这样做时,我收到了以下错误:

代码语言:javascript
复制
Error:Execution failed for task ':app:processDebugManifest'. 
Manifest merger failed : Attribute meta data#android.support.VERSION@value value=(26.0.1) from 
AndroidManifest.xml:16:13-35 is also present at [com.android.support:support-v4:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0). Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:14:9-16:38 to override.
代码语言:javascript
复制
apply plugin: 'com.android.application'

android {
compileSdkVersion 26
lintOptions {
    abortOnError false
}
defaultConfig {
    applicationId "com.example.leoconnelly.connexus"
    minSdkVersion 23
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    buildToolsVersion '26.0.1'
    //buildToolsVersion "26.0.1"


}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
buildToolsVersion '26.0.2'
}

dependencies {

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso- 
core:3.0.1'
implementation 'com.android.support:design:26.0.1'
compile 'com.squareup.picasso:picasso:2.5.2'

//Helpshift
// use version 26.1.0 instead of 26.0.2
implementation 'com.android.support:recyclerview-v7:26.0.1'
implementation 'com.android.support:cardview-v7:26.0.1'

implementation('com.helpshift:android-helpshift-en-aar:6.4.2') {
    exclude group: 'com.android.support'
    exclude module: 'design'
    exclude module: 'recyclerview'
    exclude module: 'cardview-v7'

}


implementation 'com.google.android.gms:play-services-maps:15.0.0'
}

这是我的名单:

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="com.example.leoconnelly.connexus">
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" 
android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme">
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".HealthCenterListActivity" />
    <activity android:name=".HealthCenterSelectedActivity" />
    <activity android:name=".MoreInfoActivity" />
    <meta-data
        android:name="android.support.VERSION"
        android:value="26.0.1" />

</application>

此问题仅在添加google服务时才会发生。这很困难,因为当我昨天添加helpshift时,我不得不更改许多依赖项。对如何让这件事起作用有什么建议吗?

EN

回答 1

Stack Overflow用户

发布于 2018-04-20 12:16:08

尝试将exclude module:support-v4添加到helpshift,并添加support-v4库以覆盖另一个支持库:

代码语言:javascript
复制
implementation 'com.android.support:support-v4:26.0.1'

implementation('com.helpshift:android-helpshift-en-aar:6.4.2') {
    exclude group: 'com.android.support'
    exclude module: 'design'
    exclude module: 'recyclerview'
    exclude module: 'cardview-v7'
    exclude module:support-v4
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49929115

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档