Skip to content

Error installing the app with react-native-pdf-lib #97

@spinoops

Description

@spinoops

Hi,

When I run react-native run-android :

> Task :app:checkDebugDuplicateClasses FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class com.tom_roush.fontbox.afm.AFMParser found in modules jetified-pdfbox-android-1.8.10.3-runtime (com.tom-roush:pdfbox-android:1.8.10.3) and jetified-pdfbox-android-1.8.9.1-runtime (com.tom_roush:pdfbox-android:1.8.9.1)
     Duplicate class com.tom_roush.fontbox.afm.CharMetric found in modules jetified-pdfbox-android-1.8.10.3-runtime (com.tom-roush:pdfbox-android:1.8.10.3) and jetified-pdfbox-android-1.8.9.1-runtime (com.tom_roush:pdfbox-android:1.8.9.1)
     Duplicate class com.tom_roush.fontbox.afm.Composite found in modules jetified-pdfbox-android-1.8.10.3-runtime (com.tom-roush:pdfbox-android:1.8.10.3) and jetified-pdfbox-android-1.8.9.1-runtime (com.tom_roush:pdfbox-android:1.8.9.1)
     Duplicate class com.tom_roush.fontbox.afm.CompositePart found in modules jetified-pdfbox-android-1.8.10.3-runtime (com.tom-roush:pdfbox-android:1.8.10.3) and jetified-pdfbox-android-1.8.9.1-runtime (com.tom_roush:pdfbox-android:1.8.9.1)
     Duplicate class com.tom_roush.fontbox.afm.FontMetrics found in modules jetified-pdfbox-android-1.8.10.3-runtime (com.tom-roush:pdfbox-android:1.8.10.3) and jetified-pdfbox-android-1.8.9.1-runtime (com.tom_roush:pdfbox-android:1.8.9.1)
     Duplicate class com.tom_roush.fontbox.afm.KernPair found in modules jetified-pdfbox-android-1.8.10.3-runtime (com.tom-roush:pdfbox-android:1.8.10.3) and jetified-pdfbox-android-1.8.9.1-runtime (com.tom_roush:pdfbox-android:1.8.9.1)
     Duplicate class com.tom_roush.fontbox.afm.Ligature found in modules jetified-pdfbox-android-1.8.10.3-runtime (com.tom-roush:pdfbox-android:1.8.10.3) and jetified-pdfbox-android-1.8.9.1-runtime (com.tom_roush:pdfbox-android:1.8.9.1)
     Duplicate class com.tom_roush.fontbox.afm.TrackKern found in modules jetified-pdfbox-android-1.8.10.3-runtime (com.tom-roush:pdfbox-android:1.8.10.3) and jetified-pdfbox-android-1.8.9.1-runtime (com.tom_roush:pdfbox-android:1.8.9.1)
     Duplicate class com.tom_roush.fontbox.cff.CFFCIDFont found in modules jetified-pdfbox-android-1.8.10.3-runtime (com.tom-roush:pdfbox-android:1.8.10.3) and jetified-pdfbox-android-1.8.9.1-runtime (com.tom_roush:pdfbox-android:1.8.9.1)
     Duplicate class com.tom_roush.fontbox.cff.CFFCIDFont$1 found in modules jetified-pdfbox-android-1.8.10.3-runtime (com.tom-roush:pdfbox-android:1.8.10.3) and jetified-pdfbox-android-1.8.9.1-runtime (com.tom_roush:pdfbox-android:1.8.9.1)
     Duplicate class com.tom_roush.fontbox.cff.CFFCIDFont$PrivateType1CharStringReader found in modules jetified-pdfbox-android-1.8.10.3-runtime (com.tom-roush:pdfbox-android:1.8.10.3) and jetified-pdfbox-android-1.8.9.1-runtime (com.tom_roush:pdfbox-android:1.8.9.1)
... and more ...

Then I tried to add

android {
configurations {
all*.exclude module: 'android-pdf-viewer'
}
...
packagingOptions {
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/x86_64/libjsc.so'
pickFirst lib/arm64-v8a/libjsc.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
} }
But the following error now : 
> Task :app:mergeDebugJavaResource FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugJavaResource'.
> java.nio.file.FileSystemException: ...\android\app\build\intermediates\merged_java_res\debug\out.jar: The process cannot access the file because this file is in use by another process.

Versions

"react-native": "0.64.2"
"react-native-pdf-lib": "^1.0.0"
"react-native-html-to-pdf": "^0.11.0"
"react-native-print": "^0.9.0",

Thanks for your recommandations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions