Open syedsadiqali opened 4 years ago
@syedsadiqali did you find any solution?
I find a jack its not a proper solution: some changes in this file (node_modules\@react-native-community\cli-platform-android\native_modules.gradle)
in this variable ----> def generatedFileContentsTemplate (line no 8) you gonna see this {{ packageImports }} (line no 21) after this add import fr.michaelvilleneuve.customcrop.RNCustomCropPackage;
and
in this function ----> void generatePackagesFile(File outputDir, String generatedFileName, String generatedFileContentsTemplate) { (line no 121) replace this line ----> "// ${it.name}\n${it.packageImportPath}" with if(it.name != "react-native-perspective-image-cropper"){ "// ${it.name}\n${it.packageImportPath}" }else{ "// ${it.name}\n //${it.packageImportPath}" }
Same issue here, not sure how to fix it
Hi,
the package is not yet optimized for React Native's autolinking feature. A workaround is creating a file named "react-native.config.js" in the modules root folder with the following content:
module.exports = {
dependency: {
platforms: {
android: {
packageImportPath: 'import fr.michaelvilleneuve.customcrop.RNCustomCropPackage;',
packageInstance: 'new RNCustomCropPackage()',
},
},
},
};
Hi,
the package is not yet optimized for React Native's autolinking feature. A workaround is creating a file named "react-native.config.js" in the modules root folder with the following content:
module.exports = { dependency: { platforms: { android: { packageImportPath: 'import fr.michaelvilleneuve.customcrop.RNCustomCropPackage;', packageInstance: 'new RNCustomCropPackage()', }, }, }, };
Did that and the bad import was still being generated in Package.list. Do I need to do something else in order to make it work?. Seems like my react-native-config is being ignored.
EDIT: Made it work, I had a typo and wrote react-native-config.js instead of react-native.config.js
@syedsadiqali Did you solve this error ? @JaimePata this solution not working ...
Same issue here, not sure how to fix it
@shahzaibali-code the solution worked for me, but is far from ideal. The react-native-config file that you should edit is the one from react-native-perspective-image-cropper, inside your node modules. So everytime you install the module you should change that file.
@shahzaibali-code sorry I'm not working on react native for a long time.
@JaimePata there is 2 ways you can overcome that issue.
react-native.config.js
and use it instead. If you can make a PR, it will be great.patch-package
.Currently, I used the option 2 because I have to modify the source code to fit my need.
Hi,
the package is not yet optimized for React Native's autolinking feature. A workaround is creating a file named "react-native.config.js" in the modules root folder with the following content:
module.exports = { dependency: { platforms: { android: { packageImportPath: 'import fr.michaelvilleneuve.customcrop.RNCustomCropPackage;', packageInstance: 'new RNCustomCropPackage()', }, }, }, };
Still facing the issue.
@Beeltec Hi, Your solution is worked for me. Thank you. Note: I am not using this package. I integrated opencv to develop with c++ in my React Native project. But it was giving this error. This answer fixed the problem. Thanks again ๐
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details. Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 /home/syed/projects/HeroMobileApp/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:30: error: cannot find symbol import org.opencv.RNCustomCropPackage; ^ symbol: class RNCustomCropPackage location: package org.opencv /home/syed/projects/HeroMobileApp/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:88: error: cannot find symbol new RNCustomCropPackage(), ^ symbol: class RNCustomCropPackage location: class PackageList 2 errors
FAILURE: Build failed with an exception.