Skip to content

[Android] Issue with ReactNative package #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ddolheguy opened this issue Jan 18, 2025 · 1 comment
Open

[Android] Issue with ReactNative package #2

ddolheguy opened this issue Jan 18, 2025 · 1 comment

Comments

@ddolheguy
Copy link

I found issues with the package using an Expo development built project. The iOS version works fine (with the addition of the podfile changes as per documentation, but Android is failing to build with the below error.

Looking at the ReactNative lib, it looks like

/Users/user/Development/PdfDemo/android/app/build/generated/autolinking/src/main/java/com/facebook/react/PackageList.java:14: error: cannot find symbol import com.compdfkitpdf.CompdfkitPdfPackage; ^ symbol: class CompdfkitPdfPackage location: package com.compdfkitpdf /Users/user/Development/PdfDemo/android/app/build/generated/autolinking/src/main/java/com/facebook/react/PackageList.java:72: error: cannot find symbol new CompdfkitPdfPackage(), ^ symbol: class CompdfkitPdfPackage location: class PackageList 2 errors

I was able to get it all working but had to alter the namespace of the Java files to be "com.compdfkitpdf" instead of "com.compdfkitpdf.reactnative"

@youna12345
Copy link
Contributor

Hi @ddolheguy , sorry for the late reply, we are very grateful for your feedback.
The CompdfkitPdfPackage.java file is located under the com.compdfkitpdf.reactnative directory. Once you add the @compdfkit_pdf_sdk/react_native plugin to your project, you do not need to manually reference CompdfkitPdfPackage.java. The plugin will be automatically integrated into your project.
We recommend the following steps:

  1. Clean and Rebuild the Project
    Open the Android part of your React Native project in Android Studio. In the android directory, go to Build > Clean Project to clear the cache, then select Build > Rebuild Project to rebuild the project.
  2. Reinstall the Plugin
    First, remove the plugin and then reinstall it using the following commands:
    yarn remove @compdfkit_pdf_sdk/react_native
  3. yarn add @compdfkit_pdf_sdk/react_native

Thank you for your support of our products

If you have other problems, please do not hesitate to contact us, thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants