Android-youtube-player: Please help error when adding "module contains the YouTube Player."

Created on 21 Apr 2019  ·  7Comments  ·  Source: PierfrancescoSoffritti/android-youtube-player

hi there!

Operation steps:

  1. New Project...
  2. Open file build.gradle (Module: app)
    add lineimplementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:10.0.3'
  3. Sync Now OK
  4. Run error
    Task :app:processDebugManifest FAILED C:\Users\Administrator\AndroidStudioProjects\MyApplication2\app\src\main\AndroidManifest.xml:22:18-91 Error: Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 is also present at [androidx.core:core:1.0.1] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:5:5-19:19 to override.
    FULL CODE FILE
    `apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.apptest.myapplication"
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:10.0.3'
}
`

3.Fix code add line
tools:replace="android:appComponentFactory" android:appComponentFactory="@string/app_name"

FULL CODE FILE


xmlns:tools="http://schemas.android.com/tools"
package="com.apptest.myapplication">

<application
    tools:replace="android:appComponentFactory"
    android:appComponentFactory="@string/app_name"
    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>
</application>

  1. Running the application continues the error
    * What went wrong: Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. > More than one file was found with OS independent path 'META-INF/androidx.localbroadcastmanager_localbroadcastmanager.version'

Hope everyone can help

Best regards

question

All 7 comments

Hi, are you sure this problem is related to android-youtube-player? what happens if you remove it from your dependencies?

I created a new project and added the library (com.pierfrancescosoffritti.androidyoutubeplayer: core: 10.0.3) to the project and made the above error.
If you need I will send the project to you

Are you using androidX?

Am 21.04.2019 um 14:10 schrieb kenmobi notifications@github.com:

I created a new project and added the library (com.pierfrancescosoffritti.androidyoutubeplayer: core: 10.0.3) to the project and made the above error.
If you need I will send the project to you

Thank you for responding


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Are you using androidX?

Am 21.04.2019 um 14:10 schrieb kenmobi @.*>: I created a new project and added the library (com.pierfrancescosoffritti.androidyoutubeplayer: core: 10.0.3) to the project and made the above error. If you need I will send the project to you Thank you for responding — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

I only created 1 new project and only added the "implementation 'com.pierfrancescosoffritti.androidyoutubeplayer: core: 10.0.3'" "

when i remove "implementation 'com.pierfrancescosoffritti.androidyoutubeplayer: core: 10.0.3'" the project works normally

FULL CODE
`apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.apptest.myapplication"
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:10.0.3'
}
`
Thank you.

The library doesn’t work with android support libraries, you need to use androidX library.

You can easily migrate the project by clicking Refactor > Migrate to Android X in menu bar.

You can have additional reading on this topic following this link here:
https://developer.android.com/jetpack/androidx/migrate

If you still need help I can update your gradle file to androidX once I am at my computer again (currently on mobile).

Am 22.04.2019 um 02:32 schrieb kenmobi notifications@github.com:

Are you using androidX?

Am 21.04.2019 um 14:10 schrieb kenmobi @.*>: I created a new project and added the library (com.pierfrancescosoffritti.androidyoutubeplayer: core: 10.0.3) to the project and made the above error. If you need I will send the project to you Thank you for responding — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

I only created 1 new project and only added the "implementation 'com.pierfrancescosoffritti.androidyoutubeplayer: core: 10.0.3'" "

when i remove "implementation 'com.pierfrancescosoffritti.androidyoutubeplayer: core: 10.0.3'" the project works normally

FULL CODE
`apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.apptest.myapplication"
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test🏃1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:10.0.3'
}
`
Thank you.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

Correct, you need Androidx.

@hannojg thanks a lot for the help answering questions, it's really appreciated :)

The library doesn’t work with android support libraries, you need to use androidX library. You can easily migrate the project by clicking Refactor > Migrate to Android X in menu bar. You can have additional reading on this topic following this link here: https://developer.android.com/jetpack/androidx/migrate If you still need help I can update your gradle file to androidX once I am at my computer again (currently on mobile).

Am 22.04.2019 um 02:32 schrieb kenmobi @.>: Are you using androidX? … Am 21.04.2019 um 14:10 schrieb kenmobi @.>: I created a new project and added the library (com.pierfrancescosoffritti.androidyoutubeplayer: core: 10.0.3) to the project and made the above error. If you need I will send the project to you Thank you for responding — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread. I only created 1 new project and only added the "implementation 'com.pierfrancescosoffritti.androidyoutubeplayer: core: 10.0.3'" " when i remove "implementation 'com.pierfrancescosoffritti.androidyoutubeplayer: core: 10.0.3'" the project works normally FULL CODE apply plugin: 'com.android.application' android { compileSdkVersion 28 defaultConfig { applicationId "com.apptest.myapplication" minSdkVersion 17 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test🏃1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' //implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:10.0.3' } Thank you. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

the project works perfectly: D
Thanks for the answer!

@ PierfrancescoSoffritti thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

divyas93 picture divyas93  ·  7Comments

MatanKoby picture MatanKoby  ·  4Comments

heeyounglee picture heeyounglee  ·  3Comments

rajeefmk picture rajeefmk  ·  5Comments

cnbcyln picture cnbcyln  ·  8Comments