-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
not working in my project #75
Comments
It is working in expo, could you please add more context? |
really?, |
here is what I do in order to make it work: diff --git a/node_modules/react-native-photo-editor/android/build.gradle b/node_modules/react-native-photo-editor/android/build.gradle
index 603a049..e80506a 100644
--- a/node_modules/react-native-photo-editor/android/build.gradle
+++ b/node_modules/react-native-photo-editor/android/build.gradle
@@ -44,7 +44,7 @@ repositories {
dependencies {
implementation 'com.facebook.react:react-native:+'
- implementation 'com.github.prscX:photo-editor-android:master'
+ implementation 'com.github.Rauzon:photo-editor-android:v1.1.0'
implementation 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.android.support:design:28.0.0' and also I created const fs = require("fs");
const path = require("path");
const { withAndroidManifest, withDangerousMod } = require("@expo/config-plugins");
// Function to modify the iOS Podfile properly inside the target block
function modifyPodfile(config) {
return withDangerousMod(config, [
"ios",
async (config) => {
const podfilePath = path.join(config.modRequest.platformProjectRoot, "Podfile");
if (fs.existsSync(podfilePath)) {
let podfileContent = fs.readFileSync(podfilePath, "utf-8");
const newPods = `
pod 'RNPhotoEditor', :path => '../node_modules/react-native-photo-editor/ios'
pod 'iOSPhotoEditor', :git => 'https://github.com/prscX/photo-editor', :branch => 'master'
`;
// Ensure it's inside the target block
const targetRegex = /target\s+['"]Maindeck['"]\s+do([\s\S]*?)end/;
const match = podfileContent.match(targetRegex);
if (match) {
const targetBlock = match[0];
if (!targetBlock.includes("pod 'RNPhotoEditor'")) {
const updatedTargetBlock = targetBlock.replace(/(use_react_native!\([\s\S]*?\))/, `$1\n${newPods}`);
podfileContent = podfileContent.replace(targetBlock, updatedTargetBlock);
fs.writeFileSync(podfilePath, podfileContent, "utf-8");
}
}
}
return config;
},
]);
}
// Function to modify AndroidManifest.xml
function addExtraActivityToApplication(androidManifest) {
const { manifest } = androidManifest;
if (!Array.isArray(manifest["application"])) {
console.warn("withIntentActivity: No application array in manifest?");
return androidManifest;
}
const application = manifest["application"].find(
(item) => item.$["android:name"] === ".MainApplication"
);
if (!application) {
console.warn("withIntentActivity: No .MainApplication?");
return androidManifest;
}
if (!Array.isArray(application["activity"])) {
console.warn("withIntentActivity: No activity array in .MainApplication?");
return androidManifest;
}
const photoeditorActivity = {
$: {
"android:name": "com.ahmedadeltito.photoeditor.PhotoEditorActivity",
},
};
application["activity"].push(photoeditorActivity);
return androidManifest;
}
// Main config plugin
module.exports = function withPhotoEditor(config) {
config = withAndroidManifest(config, (config) => {
config.modResults = addExtraActivityToApplication(config.modResults);
return config;
});
config = modifyPodfile(config);
return config;
}; then reference it in "plugins": [
[
"./plugins/withPhotoEditor.js"
], then run expo prebuild to get fresh ios or android folders, but Expo Go is not working, it works with Expo Build and you can ignore ios and android folders when you push code to EAS and it will work. |
with expo its not working why?
The text was updated successfully, but these errors were encountered: