Michaelvilleneuve / react-native-perspective-image-cropper

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

error: method does not override or implement a method from a supertype #8

Closed dvvtms closed 5 years ago

dvvtms commented 7 years ago

Hy, the following error happened to me after rnpic install & link & build:

.../node_modules/react-native-perspective-image-cropper/android/src/main/java/com/reactlibrary/RNCustomCropPackage.java:19: error: method does not override or implement a method from a supertype
    @Override
    ^
1 error
:react-native-perspective-image-cropper:compileReleaseJavaWithJavac FAILED
{
    "react": "16.0.0-alpha.12",
    "react-native": "0.47.1",
    "react-native-svg": "^6.0.0-rc1",
}

any quickfix? :) thank you

Michaelvilleneuve commented 7 years ago

Simply remove react-native-perspective-image-cropper from your android dependencies. :)

Android is not supported yet.

dvvtms commented 7 years ago

thnx, thats nice :)

zedtux commented 6 years ago

I'm adding react-native-perspective-image-cropper to my Android app as react-native-document-scanner doesn't support Android, and this project is mentioned from the react-native-document-scanner's README.md file and I'm facing this issue when compiling my Android app.

Obviously @Michaelvilleneuve your solution isn't for me 😄.

Can you please let me know how can I fix this?

zedtux commented 6 years ago

So based on the Java ReactPackage, removing the offending method seem to fix this issue.

The final file looks like the following :


package com.reactlibrary;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import com.facebook.react.bridge.JavaScriptModule;
public class RNCustomCropPackage implements ReactPackage {
    @Override
    public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
      return Arrays.<NativeModule>asList(new RNCustomCropModule(reactContext));
    }

    @Override
    public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
      return Collections.emptyList();
    }
}

@Michaelvilleneuve not sure if you need to manage versions or anything, otherwise I can open a PR if you'd like to. Let me know.

Michaelvilleneuve commented 6 years ago

@zedtux This lib does not support android either 😞

zedtux commented 6 years ago

Sorry @Michaelvilleneuve but I'm not following you...

By "This lib" do you mean react-native-perspective-image-cropper ? If it is, then why is "this lib" suggested from the react-native-document-scanner documentation?

react-native-perspective-image-cropper is working well on my Android phone BTW.

Michaelvilleneuve commented 6 years ago

The UI of this lib will work fine on both platforms, but if you take a look at the JAVA code you won't find any exported method in this lib.

The actual crop method won't work on your Android device. That is why I am saying that it does not support Android.

Also if you read the readme of the other lib, the document scanner, you will notice that it does not support Android either 😕

zedtux commented 6 years ago

Okay, thank you @Michaelvilleneuve for the clarifications. Do you know any RN lib, Android compatible, which could achieve the same as react-native-document-scanner or react-native-perspective-image-cropper ?

Michaelvilleneuve commented 6 years ago

Nope, I wish someone could help me implement them both. In my case, I only needed iOS so I only developped the iOS version of both

zedtux commented 6 years ago

Okay, thank you for your replies 👍

Michaelvilleneuve commented 5 years ago

Fixed by 1bd80f80e919d6c00b6be9b832a1f1625495aba2 cropper is now available on both Android and iOS