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 :
- Steps to reproduce the issue or to explain in which case you get the issue
- 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](https://private-user-images.githubusercontent.com/52721517/298952798-8bed10e6-c25c-4721-84b6-3c32f681e125.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTgyMTc0MzEsIm5iZiI6MTcxODIxNzEzMSwicGF0aCI6Ii81MjcyMTUxNy8yOTg5NTI3OTgtOGJlZDEwZTYtYzI1Yy00NzIxLTg0YjYtM2MzMmY2ODFlMTI1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFW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ZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.0B1uFf5FieWHpsREwsi-PcQFfrPudi0a1u4q9fedcw0)
hello
it works for me what i did:
- first i clean the previous build and remove the node_modules directory and install again.
- run the react-native link react-native-pdf
- 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?