Skip to content

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

Open

Description

@bunnings-kamrul

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
react-native-view-pdf@0.10.2

Activity

  1. jmorrn commented on Jun 23, 2023

    @jmorrn

    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?

  2. nicknamepiyapong commented on Jun 23, 2023

    @nicknamepiyapong

    Me too

  3. rumax commented on Jun 23, 2023

    @rumax
    Owner

    Did you also try mhiew/AndroidPdfViewer solution?

  4. jmorrn commented on Jun 23, 2023

    @jmorrn

    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'
        }
        
    
    }
    
  5. bunnings-kamrul commented on Jun 25, 2023

    @bunnings-kamrul
    Author

    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

  6. valdio commented on Jul 4, 2023

    @valdio

    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')
                 }
             }
         }
       }
    
  7. Osmon11 commented on Aug 27, 2023

    @Osmon11

    @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)
  8. zabojad commented on Oct 20, 2023

    @zabojad

    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 !

  9. TraFost commented on Jun 25, 2024

    @TraFost

    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

  10. NightCoderPal commented on Sep 17, 2024

    @NightCoderPal

    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

    This Helped.
    thanks

  11. kindapath commented on Sep 19, 2024

    @kindapath

    this worked for me
    i think its quite logical to change the dependency to DImuthuUpe's repository, since he is the new owner of the library and will maintain it

    
    allprojects {
        configurations.configureEach {
            resolutionStrategy {
                dependencySubstitution {
                    substitute(module("com.github.barteksc:android-pdf-viewer"))
                        .using(module("com.github.DImuthuUpe:AndroidPdfViewer:2.8.1"))
                        .because("401 error in main repo")
                }
            }
        }
     }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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