【问题标题】:Manifest merger failed while adding io.github.jeancsanchez.jcplayer:jcplayer:0.0.2添加 io.github.jeancsanchez.jcplayer:jcplayer:0.0.2 时清单合并失败
【发布时间】:2018-03-15 08:35:20
【问题描述】:

我正在尝试在我的项目中添加 jc 播放器。但是当我尝试同步 gradle 时出现以下错误。我该怎么办? 错误:任务 ':app:processDebugManifest' 执行失败。

清单合并失败:来自 AndroidManifest.xml:14:9-49 的属性 application@icon value=(@mipmap/ic_launcher_round) 也出现在 [io.github.jeancsanchez.jcplayer:jcplayer:0.0.2] AndroidManifest.xml:14:9-43 value=(@mipmap/ic_launcher)。 建议:将 'tools:replace="android:icon"' 添加到 AndroidManifest.xml:11:5-65:19 的元素以覆盖。

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25"
    defaultConfig {
        applicationId "com.inc.musyc.musyc"
        minSdkVersion 21
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.firebase:firebase-auth:10.0.1'
    compile 'com.google.firebase:firebase-database:10.0.1'
    compile 'com.android.support:support-v4:25.3.1'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.theartofdev.edmodo:android-image-cropper:2.4.+'
    compile 'com.google.firebase:firebase-storage:10.0.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.firebaseui:firebase-ui-database:1.1.1'
    compile 'com.squareup.okhttp:okhttp:2.5.0'
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    compile 'io.github.jeancsanchez.jcplayer:jcplayer:0.0.2'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

我的项目清单:

    <?xml version="1.0" encoding="utf-8"?>
   <manifest 
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.inc.musyc.musyc">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission 
    android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission 
    android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission 
    android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application
        android:name=".Persistence"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher_round"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <service android:name=".FirebaseMessagingService">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>

        <activity android:name=".AppMainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.inc.musyc.musyc_TARGET_NOTIFICATION" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name=".StartActivity"
            android:parentActivityName=".AppMainActivity" />
        <activity
            android:name=".SignUpActivity"
            android:parentActivityName=".StartActivity" />
        <activity
            android:name=".LogInActivity"
            android:parentActivityName=".StartActivity" />
        <activity
            android:name=".SocialMainActivity"
            android:parentActivityName=".AppMainActivity" />
        <activity
            android:name=".ForgotpassActivity"
            android:parentActivityName=".LogInActivity" />
        <activity android:name=".VerificationActivity" />
        <activity android:name=".AccountSettingActivity" />
        <activity android:name=".ChangeIntroActivity" />
        <activity android:name=".ChangePassActivity" />
        <activity android:name=".ChangeDesActivity" />
        <activity
            android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
            android:theme="@style/Base.Theme.AppCompat" />
        <activity android:name=".DemoActivity" />
        <activity android:name=".ProfileActivity" />
        <activity android:name=".dumbActivity" />
        <activity android:name=".CreatepostActivity" />
        <activity android:name=".SinglePostViewActivity"></activity>
    </application>

</manifest>

【问题讨论】:

  • 中加入这一行

标签: android audio-player android-music-player


【解决方案1】:

在 AndroidManifest.xml 中添加这个

  <application
    android:name=".Persistence"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher_round"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    tools:replace="android:icon">

【讨论】:

  • 哇!有效。谢谢。你能解释一下是什么问题吗?
  • @NPN io.github.jeancsanchez.jcplayer:jcplayer:0.0.2 这个库和你的项目都被添加了 android:roundIcon="@mipmap/ic_launcher_round" 这行在 AndroidManifest.xml您收到此错误
  • 只是想指出,即使这个解决方案有效,你最好修复那个愚蠢到让他们的应用程序文件留下图标或名称的库。库不应指定图标或应用程序名称。您可能想要分叉并推送该库来解决真正的问题,而不是放置一个覆盖黑客
猜你喜欢
  • 2018-02-18
  • 2018-03-11
  • 1970-01-01
  • 1970-01-01
  • 2018-07-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多