cordova-plugin-document-viewer
cordova-plugin-document-viewer copied to clipboard
:transformClassesWithDexForDebug Error ionic v1
I am using this plugin in an ionic v1 app and this plugin also installs cordova-plugin-android-support-v4-jar 23.2.1 whic causes trouble and :transformClassesWithDexForDebug error occours
Execution failed for task ':transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
Issue may be caused by ionic or another plugin you use in your project. Does the issue persist if you remove all other plugins from your project (should be easy to test as its a compile/build time issue)?
I guess the error indicates to different versions of android-support-v4.jar. Sorry, but I don't have any experiences with ionic. Is anybody out there who knows how to deal with this?
I also encountered this problem, but I use the ionic3。
compile - Classpath for compiling the main sources. +--- com.commit451:PhotoView:1.2.4 | --- com.android.support:support-v4:23.0.1 -> 26.0.0-alpha1 | +--- com.android.support:support-compat:26.0.0-alpha1 | | --- com.android.support:support-annotations:26.0.0-alpha1 | +--- com.android.support:support-media-compat:26.0.0-alpha1 | | +--- com.android.support:support-annotations:26.0.0-alpha1 | | --- com.android.support:support-compat:26.0.0-alpha1 () | +--- com.android.support:support-core-utils:26.0.0-alpha1 | | +--- com.android.support:support-annotations:26.0.0-alpha1 | | --- com.android.support:support-compat:26.0.0-alpha1 () | +--- com.android.support:support-core-ui:26.0.0-alpha1 | | +--- com.android.support:support-annotations:26.0.0-alpha1 | | --- com.android.support:support-compat:26.0.0-alpha1 () | --- com.android.support:support-fragment:26.0.0-alpha1 | +--- com.android.support:support-compat:26.0.0-alpha1 () | +--- com.android.support:support-core-ui:26.0.0-alpha1 () | --- com.android.support:support-core-utils:26.0.0-alpha1 () +--- com.squareup.picasso:picasso:2.5.2 +--- me.leolin:ShortcutBadger:1.1.17 +--- com.android.support:support-v4:+ -> 26.0.0-alpha1 () +--- :barcodescanner: --- com.android.support:support-v4:24.1.1+ -> 26.0.0-alpha1 ()
After installing this plugin i get the following but when i uninstall the plugin it hides :
Execution failed for task ':transformClassesWithDexForDebug'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
same problem here, any update?
To fix this issue add the Android Support v4 plugin. ionic cordova plugin add cordova-plugin-android-support-v4-jar
But this is what causing error .. adding this is causing problems in build
On 23-Jun-2017 11:45 PM, "Norman Dube" [email protected] wrote:
To fix this issue add the Android Support v4 plugin. ionic cordova plugin add cordova-plugin-android-support-v4-jar
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sitewaerts/cordova-plugin-document-viewer/issues/70#issuecomment-310736869, or mute the thread https://github.com/notifications/unsubscribe-auth/AKaTySPIrKvWIxHaQJtASVzB_piFmURiks5sHADIgaJpZM4NzfiA .
Same, issue. Any progress? @regnete why is the android-support-v4-jar plugin needed to begin with?
exactly the same issue.
any updates?
Same issue with ionic3 ... @regnete can you do something for us please ? It's a major bug ... Thanks in advance for your help !
sorry to all of you. I don't have any experiences with ionic. anybody out there to fix this?
This isn't actually an Ionic issue at all. Having a android platform created by cordova, using this plugin, the app start fails. Even if opening whole platform android folder in Android Studio, it crashes with the exact same issue.
I'll try to find something out. But... is there a reason to use the support library at all?
I thought it is needed for accessibg the files via content provider api.
Same problem, would love to still use the plugin but I can't with cordova
@mfossel and others..
I've made a fork (https://github.com/lordgreg/cordova-plugin-document-viewer/commit/bf498eb414c2a2226b6cfe3942297e78cf45a8ee) with nothing else than commenting the dependancy out of plugin.xml
. Even without the dependency, I didn't encountered any crashes since I'm always checking if my os is android, and if so... I use file opener plugin to open the file using native App.
I released and published version 0.9.4 of this plugin a few minutes ago. It contains https://github.com/sitewaerts/cordova-plugin-document-viewer/pull/77 which should fix this issue.
Could anybody please confirm?
@mfossel : Your fork should be obsolete now.
Thx for your patience! And even more thx to @oddcb !
Hi Everyone,
I run into this issue (Execution failed for task ':transformClassesWithDexForDebug'
) often, with a variety of plugins when working with ionic.
Go into your platforms/android/build.gradle and change the default config from:
defaultConfig {
versionCode cdvVersionCode ?: new BigInteger("" + privateHelpers.extractIntFromManifest("versionCode"))
applicationId privateHelpers.extractStringFromManifest("package")
if (cdvMinSdkVersion != null) {
minSdkVersion cdvMinSdkVersion
}
}
to:
defaultConfig {
versionCode cdvVersionCode ?: new BigInteger("" + privateHelpers.extractIntFromManifest("versionCode"))
applicationId privateHelpers.extractStringFromManifest("package")
if (cdvMinSdkVersion != null) {
minSdkVersion cdvMinSdkVersion
}
multiDexEnabled true
}
What your doing is adding the multiDexEnabled true
line after the if statement -- and your ionic project should build.
NOTE: You will have to do this every time you remove/readd your android platform folder.
Best of luck!
I thought we fixed this issue. Does it still appear?
@stacybrenes this is really a last-case scenario I would do. I'd rather stop using the plugin itself for a while than manually update the platform files.
But, however, this issue has been fixed with the latest version and should NOT appear anymore.