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

import undefined.RNPDFPackage error

Open Brittognanaraj opened this issue 2 years ago • 5 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?

Brittognanaraj avatar Jan 05 '24 19:01 Brittognanaraj

"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

IgorPRibeiro avatar Jan 23 '24 13:01 IgorPRibeiro

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 avatar Jan 24 '24 07:01 Princejain21

@Princejain21 Its not working for me

Brittognanaraj avatar Feb 01 '24 13:02 Brittognanaraj

Not working for me as well.

asshyy-ktz avatar Mar 20 '24 08:03 asshyy-ktz

whats the solution?

JaykumarP1 avatar Apr 18 '24 13:04 JaykumarP1