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

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

Open
ZackryPaul opened this issue Feb 22, 2023 · 2 comments
Open

Comments

@ZackryPaul
Copy link

[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
Copy link

@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:

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 @@
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
   <uses-permission android:name="android.permission.INTERNET" />
   <application
-    android:allowBackup="false"
+    android:allowBackup="true"
     tools:replace="android:allowBackup"
     android:requestLegacyExternalStorage="true"
     >

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
Copy link

@ipakhomov This works fine !! Thanks

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

3 participants