react-native-PDFView icon indicating copy to clipboard operation
react-native-PDFView copied to clipboard

Android build failing to get POM file as it is under basic authentication (getting 401)

Open bunnings-kamrul opened this issue 1 year ago • 11 comments

Describe the bug Android build failing to get POM file as it is under basic authentication (getting 401)

To Reproduce React Native build started failing all on a sudden with following error Could not GET 'https://www.jitpack.io/com/github/barteksc/android-pdf-viewer/2.8.2/android-pdf-viewer-2.8.2.pom'. Received status code 401 from server: Unauthorized

Expected behavior The build process should be able to download POM file without any issue

Screenshots image

Additional context The build process was running from AppCenter agent, with following configuration

Agent name: 'Hosted Agent' Agent machine name: 'Mac-1687481783762' Current agent version: '3.220.5' macOS 11.7.7 20G1345 Node version: v16.20.1 npm version: 8.19.4 [email protected]

bunnings-kamrul avatar Jun 23 '23 01:06 bunnings-kamrul

I've been receiving the same error in the recent hours.

Are you getting this error trying to build or running the APP locally?

The package had some opened Issues about this topic before (#204 & #226). Most of them say to add JCenter() to AllRepositories in Build.gradle but i've already tried and it failed.

Does anyone knows what is happening? Is the package down or something?

jmorrn avatar Jun 23 '23 02:06 jmorrn

Me too

nicknamepiyapong avatar Jun 23 '23 03:06 nicknamepiyapong

Did you also try mhiew/AndroidPdfViewer solution?

rumax avatar Jun 23 '23 06:06 rumax

I tried the solution of @rumax and it worked.

I've two projects with diferent versions 0.71 and 0.64.

The project with version of 0.64 i had to put the following config at android/app/build.gradle

android{
....

 packagingOptions {
        pickFirst '**/armeabi-v7a/libc++_shared.so'
        pickFirst '**/x86/libc++_shared.so'
        pickFirst '**/arm64-v8a/libc++_shared.so'
        pickFirst '**/x86_64/libc++_shared.so'
    }
    

}

jmorrn avatar Jun 23 '23 22:06 jmorrn

Similar approach as @Jeanluca-Moren0 worked for me. I have made the following changes

  1. upgraded react-native-view-pdf to the latest (0.14.0)
  2. using latest android pdf viewer by adding flowing lines in android/build.gradle
     pdfViewerVersion = "3.2.0-beta.1"
     pdfViewerRepo = "com.github.mhiew"
  1. Also added common shared library resolution in android/app/build.gradle
android {
 ...
    packagingOptions {
        pickFirst '**/libc++_shared.so'
        pickFirst '**/libfbjni.so'
    }
}

Hope this helps

bunnings-kamrul avatar Jun 25 '23 22:06 bunnings-kamrul

A temporary solution is to substitute the underlying android package com.github.barteksc:android-pdf-viewer with another fork of it.

On android/build.gradle add the following:

allprojects{
// .... other code
configurations.all {
         resolutionStrategy {
             dependencySubstitution {
                 substitute module('com.github.barteksc:android-pdf-viewer') using module('com.github.mhiew:android-pdf-viewer:3.2.0-beta.3')
             }
         }
     }
   }

valdio avatar Jul 04 '23 09:07 valdio

@valdio Received the following error

FAILURE: Build completed with 2 failures.

1: Task 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.github.barteksc.pdfviewer.AnimationManager found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.AnimationManager$XAnimation found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.AnimationManager$YAnimation found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.AnimationManager$ZoomAnimation found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.BuildConfig found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3)
Duplicate class com.github.barteksc.pdfviewer.CacheManager found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.CacheManager$PagePartComparator found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.DecodingAsyncTask found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.githb .TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.DragPinchManager found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.PDFView found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3)
Duplicate class com.github.barteksc.pdfviewer.PDFView$1 found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3)
Duplicate class com.github.barteksc.pdfviewer.PDFView$Configurator found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.PDFView$ScrollDir found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.PDFView$State found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.PagesLoader found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3)
Duplicate class com.github.barteksc.pdfviewer.PagesLoader$1 found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.PagesLoader$GridSize found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.PagesLoader$Holder found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.PagesLoader$RenderRange found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.PdfFile found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3)
Duplicate class com.github.barteksc.pdfviewer.RenderingHandler found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.RenderingHandler$1 found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.RenderingHandler$2 found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.RenderingHandler$RenderingTask found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.exception.FileNotFoundException found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.exception.PageRenderingException found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.link.DefaultLinkHandler found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.link.LinkHandler found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.listener.Callbacks found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.listener.OnDrawListener found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.listener.OnErrorListener found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.listener.OnLoadCompleteListener found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.listener.OnLongPressListener found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.listener.OnPageChangeListener found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.listener.OnPageErrorListener found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.listener.OnPageScrollListener found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.listener.OnRenderListener found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.listener.OnTapListener found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.model.LinkTapEvent found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.model.PagePart found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.scroll.DefaultScrollHandle found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.scroll.DefaultScrollHandle$1 found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.scroll.ScrollHandle found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.source.AssetSource found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-e ta.3) Duplicate class com.github.barteksc.pdfviewer.source.ByteArraySource found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.source.DocumentSource found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.source.FileSource found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.source.InputStreamSource found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.source.UriSource found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.util.ArrayUtils found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.util.Constants found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.util.Constants$Cache found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.util.Constants$Pinch found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.util.FileUtils found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.util.FitPolicy found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.util.MathUtils found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.util.PageSizeCalculator found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.util.PageSizeCalculator$1 found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.util.SnapEdge found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3) Duplicate class com.github.barteksc.pdfviewer.util.Util found in modules jetified-AndroidPdfViewer-3.1.0-beta.3-runtime (com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3) and jetified-android-pdf-viewer-3.2.0-beta.3-runtime (com.github.mhiew:android-pdf-viewer:3.2.0-beta.3)
Duplicate class com.shockwave.pdfium.BuildConfig found in modules jetified-PdfiumAndroid-1.0.1-runtime (com.github.TalbotGooday:PdfiumAndroid:1.0.1) and jetified-pdfium-android-1.9.2-runtime (com.github.mhiew:pdfium-android:1.9.2) Duplicate class com.shockwave.pdfium.PdfDocument found in modules jetified-PdfiumAndroid-1.0.1-runtime (com.github.TalbotGooday:PdfiumAndroid:1.0.1) and jetified-pdfium-android-1.9.2-runtime (com.github.mhiew:pdfium-android:1.9.2) Duplicate class com.shockwave.pdfium.PdfDocument$Bookmark found in modules jetified-PdfiumAndroid-1.0.1-runtime (com.github.TalbotGooday:PdfiumAndroid:1.0.1) and jetified-pdfium-android-1.9.2-runtime (com.github.mhiew:pdfium-android:1.9.2) Duplicate class com.shockwave.pdfium.PdfDocument$Link found in modules jetified-PdfiumAndroid-1.0.1-runtime (com.github.TalbotGooday:PdfiumAndroid:1.0.1) and jetified-pdfium-android-1.9.2-runtime (com.github.mhiew:pdfium-android:1.9.2) Duplicate class com.shockwave.pdfium.PdfDocument$Meta found in modules jetified-PdfiumAndroid-1.0.1-runtime (com.github.TalbotGooday:PdfiumAndroid:1.0.1) and jetified-pdfium-android-1.9.2-runtime (com.github.mhiew:pdfium-android:1.9.2) Duplicate class com.shockwave.pdfium.PdfPasswordException found in modules jetified-PdfiumAndroid-1.0.1-runtime (com.github.TalbotGooday:PdfiumAndroid:1.0.1) and jetified-pdfium-android-1.9.2-runtime (com.github.mhiew:pdfium-android:1.9.2) Duplicate class com.shockwave.pdfium.PdfiumCore found in modules jetified-PdfiumAndroid-1.0.1-runtime (com.github.TalbotGooday:PdfiumAndroid:1.0.1) and jetified-pdfium-android-1.9.2-runtime (com.github.mhiew:pdfium-android:1.9.2) Duplicate class com.shockwave.pdfium.util.Size found in modules jetified-PdfiumAndroid-1.0.1-runtime (com.github.TalbotGooday:PdfiumAndroid:1.0.1) and jetified-pdfium-android-1.9.2-runtime (com.github.mhiew:pdfium-android:1.9.2) Duplicate class com.shockwave.pdfium.util.SizeF found in modules jetified-PdfiumAndroid-1.0.1-runtime (com.github.TalbotGooday:PdfiumAndroid:1.0.1) and jetified-pdfium-android-1.9.2-runtime (com.github.mhiew:pdfium-android:1.9.2)

 Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.        
  • Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

2: Task failed with an exception.

  • What went wrong: java.lang.StackOverflowError (no error message)

Osmon11 avatar Aug 27 '23 07:08 Osmon11

Similar approach as @Jeanluca-Moren0 worked for me. I have made the following changes

upgraded react-native-view-pdf to the latest (0.14.0) using latest android pdf viewer by adding flowing lines in android/build.gradle pdfViewerVersion = "3.2.0-beta.1" pdfViewerRepo = "com.github.mhiew" Also added common shared library resolution in android/app/build.gradle android { ... packagingOptions { pickFirst '/libc++_shared.so' pickFirst '/libfbjni.so' } } Hope this helps

Worked for me with a RN0.72.4 project, thanks !

zabojad avatar Oct 20 '23 16:10 zabojad

Similar approach as @Jeanluca-Moren0 worked for me. I have made the following changes

  1. upgraded react-native-view-pdf to the latest (0.14.0)
  2. using latest android pdf viewer by adding flowing lines in android/build.gradle
     pdfViewerVersion = "3.2.0-beta.1"
     pdfViewerRepo = "com.github.mhiew"
  1. Also added common shared library resolution in android/app/build.gradle
android {
 ...
    packagingOptions {
        pickFirst '**/libc++_shared.so'
        pickFirst '**/libfbjni.so'
    }
}

Hope this helps

it works, but when i tried to use url. my app suddenly force close. im confused

TraFost avatar Jun 25 '24 17:06 TraFost