react-native-perspective-image-cropper icon indicating copy to clipboard operation
react-native-perspective-image-cropper copied to clipboard

cannot find symbol import org.opencv.RNCustomCropPackage;

Open hashimkhatri opened this issue 5 years ago • 11 comments

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

hashimkhatri avatar Dec 26 '19 17:12 hashimkhatri

@hashimkhatri Did you found any solution?

tarunpatel004 avatar Jan 17 '20 05:01 tarunpatel004

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. 🤔

TakaKeiji avatar Mar 23 '20 19:03 TakaKeiji

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...

TakaKeiji avatar Mar 23 '20 19:03 TakaKeiji

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

Sin título

now the imports and build are ok.

photo_2020-03-24 18 01 50

Thanks again to @TakaKeiji

More info: https://github.com/react-native-community/cli/blob/master/docs/platforms.md

clsource avatar Mar 24 '20 21:03 clsource

Error: import org.opencv.RNCustomCropPackage;

symbol: class RNCustomCropPackage location: package org.opencv

Screenshot 2020-04-06 at 7 36 13 PM


My React Configuration

"react": "16.11.0", "react-native": "0.62.0",


Did you find any solution ? @tarunpatel004 @hashimkhatri @clsource @Michaelvilleneuve

akashSilicon avatar Apr 06 '20 14:04 akashSilicon

@clsource Thank you so much <3

duclahoang avatar Apr 19 '20 05:04 duclahoang

@clsource where react-native config.js file is located ??

Ahmad5448 avatar May 18 '20 17:05 Ahmad5448

@clsource where react-native config.js file is located ??

https://github.com/facebook/react-native/blob/0.60-stable/react-native.config.js

clsource avatar May 18 '20 20:05 clsource

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

:-)

rycks avatar May 25 '20 12:05 rycks

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

Sin título

now the imports and build are ok.

photo_2020-03-24 18 01 50

Thanks again to @TakaKeiji

More info: https://github.com/react-native-community/cli/blob/master/docs/platforms.md

Thanks

mohdaamir8182 avatar Mar 25 '21 12:03 mohdaamir8182

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

ShoaibReactNative avatar Sep 22 '22 15:09 ShoaibReactNative