Can't build the app
Can not build the app with react-native version 0.76.6, error going on:
> Task :app:compileReleaseJavaWithJavac
FAILED
/home/expo/workingdir/build/StickerSmash/android/app/build/generated/autolinking/src/main/java/com/facebook/react/PackageList.java:16: error: cannot find symbol
import com.pdfthumbnail.PdfThumbnailPackage;
^
symbol: class PdfThumbnailPackage
location: package com.pdfthumbnail
/home/expo/workingdir/build/StickerSmash/android/app/build/generated/autolinking/src/main/java/com/facebook/react/PackageList.java:63: error: cannot find symbol
new PdfThumbnailPackage()
^
symbol: class PdfThumbnailPackage
location: class PackageList
Patch is applied to fix previous error mentioned in issues:
diff --git a/node_modules/react-native-pdf-thumbnail/android/src/main/java/org/songsterq/pdfthumbnail/PdfThumbnailModule.kt b/node_modules/react-native-pdf-thumbnail/android/src/main/java/org/songsterq/pdfthumbnail/PdfThumbnailModule.kt
index 921b578..3e4aa6b 100644
--- a/node_modules/react-native-pdf-thumbnail/android/src/main/java/org/songsterq/pdfthumbnail/PdfThumbnailModule.kt
+++ b/node_modules/react-native-pdf-thumbnail/android/src/main/java/org/songsterq/pdfthumbnail/PdfThumbnailModule.kt
@@ -98,7 +98,7 @@ class PdfThumbnailModule(reactContext: ReactApplicationContext) :
currentPage.close()
// Some bitmaps have transparent background which results in a black thumbnail. Add a white background.
- val bitmapWhiteBG = Bitmap.createBitmap(bitmap.width, bitmap.height, bitmap.config)
+ val bitmapWhiteBG = Bitmap.createBitmap(bitmap.width, bitmap.height, bitmap.config ?: Bitmap.Config.ARGB_8888)
val canvas = Canvas(bitmapWhiteBG)
canvas.drawBitmap(bitmap, 0f, 0f, null)
bitmap.recycle()
Same issue.. Not able to build app @songsterq
same issue with react-native: "0.76.7". Patch doesn't work
Use this package: react-native-pdf-to-image
Ok.. I have resolved it.. For new versions of react native, it is compulsory to have same "namespace" as mentioned in AndroidManifest.xml file
I have attached a patch file.. Anyone facing the issue can use this patch file to successfully build its project
react-native-pdf-thumbnail+1.3.1.patch
@justpeny @songsterq @arcvlad
! WORKS FOR ME ! Try to replace with react-native-pdf-page-image