Please help error when adding "module contains the YouTube Player."
See original GitHub issuehi there!
Operation steps:
- New Project…
- Open file build.gradle (Module: app)
add line
implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:10.0.3'
- Sync Now OK
- 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🏃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
<? xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.apptest.myapplication">
</manifest><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>
- 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
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
the project works perfectly: D Thanks for the answer!
@ PierfrancescoSoffritti thanks
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).