wonday / react-native-pdf

A <Pdf /> component for react-native
MIT License
1.57k stars 532 forks source link

import undefined.RNPDFPackage error #800

Open Brittognanaraj opened 6 months ago

Brittognanaraj commented 6 months ago

What react-native version are you using? "react-native": "0.68.3", What react-native-pdf version are you using? "react-native-pdf": "6.7.2", What platform does your issue occur on? (android/ios/both) android Describe your issue as precisely as possible : 1) Steps to reproduce the issue or to explain in which case you get the issue 2) Interesting logs

Join a screenshot or video of the problem on the simulator or device?

Show us the code you are using?

IgorPRibeiro commented 5 months ago

"react-native": "0.67.5" "react-native-pdf": "^6.7.2"

1 - Running project;

BUILD FAILED in 22s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
mymac/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:73: error: package undefined does not exist
import undefined.RNPDFPackage;
                ^
mymac/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:172: error: cannot find symbol
      new RNPDFPackage(),
          ^
  symbol:   class RNPDFPackage
  location: class PackageList
Note: mymac/android/app/src/debug/java/com/icoop/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
Screenshot 2024-01-23 at 10 15 42 Screenshot 2024-01-23 at 10 23 06
Princejain21 commented 5 months ago

hello it works for me what i did:

  1. first i clean the previous build and remove the node_modules directory and install again.
  2. run the react-native link react-native-pdf
  3. now in build folder you will found import com.wonday.pdf.RNPDFPackage instead of import com.undefined.RNPDFPackage;

now it will work fine. thanks

Brittognanaraj commented 5 months ago

@Princejain21 Its not working for me

asshyy-ktz commented 3 months ago

Not working for me as well.

JaykumarP1 commented 2 months ago

whats the solution?