baronha / react-native-photo-editor

🌄 Photo editor using native modules for iOS and Android. Inherit from 2 available libraries, ZLImageEditor (iOS) and PhotoEditor (Android)
MIT License
440 stars 138 forks source link

Task :baronha_react-native-photo-editor:compileDebugKotlin FAILED #49

Open ZackryPaul opened 1 year ago

ZackryPaul commented 1 year ago

[stderr] Attribute application@allowBackup value=(true) from AndroidManifest.xml:16:162-188 [stderr] is also present at [:baronha_react-native-photo-editor] AndroidManifest.xml:14:9-36 value=(false). [stderr] Suggestion: add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml:6:5-117 to override.

Task :expo-dev-client:compileDebugJavaWithJavac Task :baronha_react-native-photo-editor:compileDebugKotlin FAILED

I've gotten the android build to build successfully before with this package INCLUDED in the package.json. However the build crashes on start up with the package installed. I recently updated to expo 47 recently and after that I can't get a successful build on android even with adding the tools:replace.... suggestion. How do you fix this for android? The application builds fine for iOS with eas but fails for android. Is this just not EXPO/EAS compatible for android?

Any help would be great, thanks in advance.

ipakhomov commented 1 year ago

@ZackryPaul I made this package working with Expo Dev Client for Android by applying patch with changes in files node_modules/@baronha/react-native-photo-editor/android/gradle.properties and node_modules/@baronha/react-native-photo-editor/android/src/main/AndroidManifest.xml mentioned in this comment.

You can use patch-package for that. Here is the patch content just in case:

```patch diff --git a/node_modules/@baronha/react-native-photo-editor/android/gradle.properties b/node_modules/@baronha/react-native-photo-editor/android/gradle.properties index 464211f..c5f5e6d 100644 --- a/node_modules/@baronha/react-native-photo-editor/android/gradle.properties +++ b/node_modules/@baronha/react-native-photo-editor/android/gradle.properties @@ -1,4 +1,4 @@ -PhotoEditor_kotlinVersion=1.3.50 +PhotoEditor_kotlinVersion=1.6.0 PhotoEditor_compileSdkVersion=29 PhotoEditor_buildToolsVersion=29.0.2 PhotoEditor_targetSdkVersion=29 diff --git a/node_modules/@baronha/react-native-photo-editor/android/src/main/AndroidManifest.xml b/node_modules/@baronha/react-native-photo-editor/android/src/main/AndroidManifest.xml index 5d9f411..7e781b6 100644 --- a/node_modules/@baronha/react-native-photo-editor/android/src/main/AndroidManifest.xml +++ b/node_modules/@baronha/react-native-photo-editor/android/src/main/AndroidManifest.xml @@ -5,7 +5,7 @@ ```

Install patch-package, add it to postinstall script in package.json, and put it the diff above into patches/@baronha+react-native-photo-editor+1.1.6.patch. After that rebuild your android app using EAS.

sainijagjit commented 1 year ago

@ipakhomov This works fine !! Thanks