Skip to content
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

Build issue #84

Open
sathibault opened this issue Jun 28, 2023 · 3 comments
Open

Build issue #84

sathibault opened this issue Jun 28, 2023 · 3 comments

Comments

@sathibault
Copy link

I'm having trouble using this module in my own RN application. Any thoughts as to what would cause this:

> Task :app:compileDebugJavaWithJavac FAILED
D:\brilliant\monocle\HuntTheWild\android\app\build\generated\rncli\src\main\java\com\facebook\react\PackageList.java:15: error: cannot find symbol
import org.inaturalist.inatcamera.INatCameraViewPackage;
                                 ^
  symbol:   class INatCameraViewPackage
  location: package org.inaturalist.inatcamera
D:\brilliant\monocle\HuntTheWild\android\app\build\generated\rncli\src\main\java\com\facebook\react\PackageList.java:61: error: cannot find symbol
      new INatCameraViewPackage()
          ^
  symbol:   class INatCameraViewPackage
  location: class PackageList
@sathibault
Copy link
Author

I guess the package name should be org.inaturalist.inatcamera.nativecamera, but not why it's not being generated correctly.

@jtklein
Copy link
Contributor

jtklein commented Jun 29, 2023

Have you followed the "Integrating the Library with a React Native app" section in the README.
Acording to this, it should import from org.inaturalist.inatcamera.nativecamera.INatCameraViewPackage.

@sathibault
Copy link
Author

Yes, I did follow the README. That import mentioned there is in the MainApplication. React native automatically generates the PackageList.java file and seems to get it wrong. I found a work around, although I don't think this is normally necessary.

Work around in react-native.config.js:

module.exports = {
  "dependencies": {
    "react-native-inat-camera": {
      "platforms": {
        "android": {
          "packageImportPath": "import org.inaturalist.inatcamera.nativecamera.INatCameraViewPackage;",
          "packageInstance": "new INatCameraViewPackage()",
        }
      },
    }
  }
}

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