I am using a third party library that has below two dependencies AndroidX
:
implementation 'androidx.navigation:navigation-fragment:2.1.0-alpha02'
implementation 'androidx.navigation:navigation-ui:2.1.0-alpha02'
While compiling the host application, which still uses android.support.*
, I got below error:
AAPT: error: attribute 'com.x.y.android.debug:defaultNavHost' not found.
AAPT: error: attribute 'com.x.y.android.debug:startDestination' not found.
To fix it, I added the respective AndroidX
libraries in my host app and encountered below error:
Task :App:transformDexArchiveWithExternalLibsDexMergerForChaseDebug FAILED D8: Program type already present: com.google.android.material.internal.package-info
Please note: The library is already reverse-jetified using this link
./jetifier-standalone -r -i myAndroidXLib.aar -o supportLibVersion.aar
I have already tried adding below lines in gradle.properties
file:
android.useAndroidX = true
android.enableJetifier=false
Already tried exluding from the packging-info:
packagingOptions {
exclude 'com.google.android.material.internal.package-info'
}
Both the above solution didn't work at all. Any suggestions?