Michaelvilleneuve / react-native-perspective-image-cropper

Perform custom crop, resizing and perspective correction 📐🖼
MIT License
306 stars 128 forks source link

cannot find symbol import org.opencv.RNCustomCropPackage; #35

Open hashimkhatri opened 4 years ago

hashimkhatri commented 4 years ago

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

tarunpatel004 commented 4 years ago

@hashimkhatri Did you found any solution?

TakaKeiji commented 4 years ago

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 commented 4 years ago

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

clsource commented 4 years ago

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

akashSilicon commented 4 years ago

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

duclahoang commented 4 years ago

@clsource Thank you so much <3

Ahmad5448 commented 4 years ago

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

clsource commented 4 years ago

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

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

rycks commented 4 years ago

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

:-)

mohdaamir8182 commented 3 years ago

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

ShoaibReactNative commented 2 years ago

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