Open hashimkhatri opened 4 years ago
@hashimkhatri Did you found any solution?
I've just found after following the install steps the import is not made correctly On PackageList.java:
// react-native-perspective-image-cropper
import org.opencv.RNCustomCropPackage;
But should be like this (I think):
// react-native-perspective-image-cropper
import fr.michaelvilleneuve.customcrop.RNCustomCropPackage;
Changing this on the file, resets automatically on next build command, so no clue how to ride off the error. 🤔
Error: cannot find symbol import org.opencv.RNCustomCropPackage;
after changing in MainApplication.java import org.opencv.RNCustomCropPackage to import fr.michaelvilleneuve.customcrop.RNCustomCropPackage;
still same issue. :'( I lost my 7 days on research to reslove this issue
Every time you make a build action this file is regenerated and your changes are lost, i don't have idea how to change, patch or fix this behavior...
The main issue is that this library is outdated. @TakaKeiji found a solution.
You just need to modify react-native.config.js
to fix the import order.
module.exports = {
dependencies: {
'react-native-perspective-image-cropper': {
platforms: {
android: {
packageImportPath: 'import fr.michaelvilleneuve.customcrop.RNCustomCropPackage;',
}
}
}
}
};
with this change
now the imports and build are ok.
Thanks again to @TakaKeiji
More info: https://github.com/react-native-community/cli/blob/master/docs/platforms.md
Error: import org.opencv.RNCustomCropPackage;
symbol: class RNCustomCropPackage location: package org.opencv
My React Configuration
"react": "16.11.0", "react-native": "0.62.0",
Did you find any solution ? @tarunpatel004 @hashimkhatri @clsource @Michaelvilleneuve
@clsource Thank you so much <3
@clsource where react-native config.js file is located ??
@clsource where react-native config.js file is located ??
https://github.com/facebook/react-native/blob/0.60-stable/react-native.config.js
SOLVED
The main issue is that this library is outdated. @TakaKeiji found a solution. You just need to modify
react-native-config.js
to fix the import order.
Warning: right file name is react-native.config.js, not react-native-config.js
:-)
SOLVED
The main issue is that this library is outdated. @TakaKeiji found a solution. You just need to modify
react-native.config.js
to fix the import order.module.exports = { dependencies: { 'react-native-perspective-image-cropper': { platforms: { android: { packageImportPath: 'import fr.michaelvilleneuve.customcrop.RNCustomCropPackage;', } } } } };
with this change
now the imports and build are ok.
Thanks again to @TakaKeiji
More info: https://github.com/react-native-community/cli/blob/master/docs/platforms.md
Thanks
react-native.config.js file works awesome but is there any way out to add this dynamically like whenever I download the project from my source control I want just only to run yarn and that add these configuration automatically to my node_modules like one here issue and also the react-native.config.js file
Error: cannot find symbol import org.opencv.RNCustomCropPackage;
after changing in MainApplication.java import org.opencv.RNCustomCropPackage to import fr.michaelvilleneuve.customcrop.RNCustomCropPackage;
still same issue. :'( I lost my 7 days on research to reslove this issue