wonday / react-native-pdf

A <Pdf /> component for react-native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

import undefined.RNPDFPackage error

Brittognanaraj opened this issue · comments

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?

"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

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

@Princejain21 Its not working for me

Not working for me as well.

whats the solution?