christopherdro / react-native-html-to-pdf

Convert html strings to PDF documents using React Native
MIT License
434 stars 265 forks source link

Task :app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED #162

Closed JintoAntony closed 3 years ago

JintoAntony commented 4 years ago

Installed the plugin. Then when I try to take a build, it shows the following error

`> Task :react-native-html-to-pdf:compileDebugJavaWithJavac

Task :app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings 175 actionable tasks: 24 executed, 151 up-to-date Note: /Users/prime/Dropbox/Development/Donams/E-Sell-MobileApp/node_modules/react-native-html-to-pdf/android/src/main/java/android/print/PdfConverter.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. D8: Cannot fit requested classes in a single dex file (# methods: 84050 > 65536)

FAILURE: Build failed with an exception.

Any idea how to fix this ?

"react": "16.9.0", "react-native": "0.61.5", "react-native-html-to-pdf": "^0.8.0",

sagarrs commented 4 years ago

same issue any solution ?

rikur commented 4 years ago

I fixed this by upgrading mindSdkVersion to 21 for my app and all subprojects and by enabling multiDex

android/build.gradle

buildscript {
    ext {
        minSdkVersion = 21
..

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                minSdkVersion = 21
            }
        }
    }
}

android/app/build.gradle

android {
    defaultConfig {
        multiDexEnabled true
stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.