Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with PhotoEditorActivity: requestFeature() Error #62

Open
nasyx-rakeeb opened this issue Aug 28, 2023 · 0 comments
Open

Issue with PhotoEditorActivity: requestFeature() Error #62

nasyx-rakeeb opened this issue Aug 28, 2023 · 0 comments

Comments

@nasyx-rakeeb
Copy link

Hello,

I'm encountering an issue when trying to use the @baronha/react-native-photo-editor package in my Expo app. After patching the package to make it compatible with Expo Dev Client for Android, I'm now facing a java.lang.RuntimeException error related to the requestFeature() method call. It seems that this error is caused by the PhotoEditorActivity.

Steps to Reproduce

  1. Install @baronha/react-native-photo-editor version 1.1.6.
  2. Apply the patch mentioned here to make it work with expo dev client.
  3. Integrate the PhotoEditor component in the app.
  4. Attempt to use the PhotoEditor functionality.

Expected Behavior

The PhotoEditor component should launch and allow me to edit images without any errors.

Actual Behavior

When I attempt to use the PhotoEditor component, I encounter the following error:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nasyxrakeeb.test/com.reactnativephotoeditor.activity.PhotoEditorActivity}: android.util.AndroidRuntimeException: requestFeature() must be called before adding content

Additional Information

  • Expo SDK Version: 49.0.8
  • React Native Version: 0.72.4
  • @baronha/react-native-photo-editor Version: 1.1.6
  • Android Device: Samsung a50 (Physical)
  • Android OS Version: 11
  • I had to patch the package to make it work with Expo Dev Client for Android.

CODE

const remoteURL =
  "https://images.unsplash.com/photo-1634915728822-5ad85582837a?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=774&q=80";

export default function App() {
  const edit = async () => {
    try {
      const result = await PhotoEditor.open({
        path: remoteURL,
        stickers: [],
      });
    } catch (error) {
      console.log({ error });
    }
  };

  return (
    <View>
      <Button onPress={edit}>
        Edit
      </Button>
    </View>
  );
}

I appreciate your help in resolving this issue. Please let me know if there's any additional information needed from my end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant