@phucprime/react-native-image-editor 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/libs/README.md +7 -0
- package/android/libs/photo-editor-android-original.jar +0 -0
- package/android/libs/photo-editor-android.jar +0 -0
- package/android/src/main/res/layout/photo_editor_sdk_image_item_list.xml +16 -0
- package/android/src/main/res/layout/photo_editor_sdk_text_item_list.xml +13 -0
- package/package.json +5 -5
- package/react-native-image-editor.podspec +8 -5
- package/ios/RNPhotoEditor.m +0 -24
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
The real problem was that photo-editor-android.jar is a plain JAR (not an AAR). When distributed as a JAR, the Android build system has no way to generate an R.java for its package com.ahmedadeltito.photoeditorsdk — that only happens for AAR/library modules. The JAR's compiled bytecode hardcodes references to com.ahmedadeltito.photoeditorsdk.R$layout, which never gets created in the final APK.
|
|
2
|
+
|
|
3
|
+
The previous attempt (adding a R.java stub) was the right idea but Android's build system ignores hand-written R.java files — it generates and owns the R classes itself and overwrites them.
|
|
4
|
+
|
|
5
|
+
The working fix: Used a Python script to directly rewrite the constant pool in PhotoEditorSDK.class inside the JAR — replacing every com/ahmedadeltito/photoeditorsdk/R reference with ui/photoeditor/R (your library's actual namespace). Now at runtime, the SDK correctly resolves ui.photoeditor.R$layout.photo_editor_sdk_image_item_list and ui.photoeditor.R$id.photo_editor_sdk_image_iv, which exist in your compiled resources.
|
|
6
|
+
|
|
7
|
+
The two layout XMLs created in the previous step (photo_editor_sdk_image_item_list.xml and photo_editor_sdk_text_item_list.xml) are still needed — they provide the actual layouts the SDK inflates.
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
+
android:id="@+id/photo_editor_sdk_image_rl"
|
|
3
|
+
android:layout_width="match_parent"
|
|
4
|
+
android:layout_height="wrap_content">
|
|
5
|
+
|
|
6
|
+
<ImageView
|
|
7
|
+
android:id="@+id/photo_editor_sdk_image_iv"
|
|
8
|
+
android:layout_width="wrap_content"
|
|
9
|
+
android:layout_height="80dp"
|
|
10
|
+
android:layout_centerHorizontal="true"
|
|
11
|
+
android:layout_margin="12dp"
|
|
12
|
+
android:adjustViewBounds="true"
|
|
13
|
+
android:gravity="center"
|
|
14
|
+
android:scaleType="fitCenter" />
|
|
15
|
+
|
|
16
|
+
</RelativeLayout>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
+
android:id="@+id/photo_editor_sdk_text_rl"
|
|
3
|
+
android:layout_width="wrap_content"
|
|
4
|
+
android:layout_height="wrap_content">
|
|
5
|
+
|
|
6
|
+
<TextView
|
|
7
|
+
android:id="@+id/photo_editor_sdk_text_tv"
|
|
8
|
+
android:layout_width="wrap_content"
|
|
9
|
+
android:layout_height="wrap_content"
|
|
10
|
+
android:padding="10dp"
|
|
11
|
+
android:textSize="18sp" />
|
|
12
|
+
|
|
13
|
+
</RelativeLayout>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phucprime/react-native-image-editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "React Native: Native Image Editor for iOS and Android with drawing, text, stickers, cropping and more",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -70,12 +70,12 @@
|
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@types/react": "
|
|
74
|
-
"prettier": "
|
|
73
|
+
"@types/react": "18.2.0 || 19.0.0",
|
|
74
|
+
"prettier": "3.2.0",
|
|
75
75
|
"react-native": "0.78.2",
|
|
76
|
-
"typescript": "
|
|
76
|
+
"typescript": "5.9.3"
|
|
77
77
|
},
|
|
78
78
|
"engines": {
|
|
79
79
|
"node": ">=16.0.0"
|
|
80
80
|
}
|
|
81
|
-
}
|
|
81
|
+
}
|
|
@@ -15,6 +15,14 @@ Pod::Spec.new do |s|
|
|
|
15
15
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
16
16
|
s.dependency "iOSPhotoEditor"
|
|
17
17
|
|
|
18
|
+
# Always enforce C++17 so that C++ standard-library headers (<utility>, <vector>,
|
|
19
|
+
# <chrono>, …) resolve correctly when the pod is compiled alongside React Native's
|
|
20
|
+
# C++ TurboModule/JSI headers, regardless of architecture or RN version.
|
|
21
|
+
s.pod_target_xcconfig = {
|
|
22
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
|
23
|
+
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
24
|
+
}
|
|
25
|
+
|
|
18
26
|
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
19
27
|
if respond_to?(:install_modules_dependencies, true)
|
|
20
28
|
install_modules_dependencies(s)
|
|
@@ -24,11 +32,6 @@ Pod::Spec.new do |s|
|
|
|
24
32
|
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
25
33
|
if ENV["RCT_NEW_ARCH_ENABLED"] == "1"
|
|
26
34
|
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
27
|
-
s.pod_target_xcconfig = {
|
|
28
|
-
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
29
|
-
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
30
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
|
31
|
-
}
|
|
32
35
|
s.dependency "React-Codegen"
|
|
33
36
|
s.dependency "RCT-Folly"
|
|
34
37
|
s.dependency "RCTRequired"
|
package/ios/RNPhotoEditor.m
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
#import <React/RCTBridgeModule.h>
|
|
2
|
-
|
|
3
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
4
|
-
#import <RNPhotoEditorSpec/RNPhotoEditorSpec.h>
|
|
5
|
-
#endif
|
|
6
|
-
|
|
7
|
-
@interface RCT_EXTERN_MODULE (RNPhotoEditor, NSObject)
|
|
8
|
-
|
|
9
|
-
RCT_EXTERN_METHOD(Edit : (NSDictionary *)props onDone : (RCTResponseSenderBlock)
|
|
10
|
-
onDone onCancel : (RCTResponseSenderBlock)onCancel)
|
|
11
|
-
|
|
12
|
-
+ (BOOL)requiresMainQueueSetup {
|
|
13
|
-
return YES;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@end
|
|
17
|
-
|
|
18
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
19
|
-
// Conform to the codegen-generated protocol for TurboModule support.
|
|
20
|
-
// The actual implementation is in RNPhotoEditor.swift; this declaration
|
|
21
|
-
// tells the compiler the Swift class satisfies the protocol.
|
|
22
|
-
@interface RNPhotoEditor () <NativeRNPhotoEditorSpec>
|
|
23
|
-
@end
|
|
24
|
-
#endif
|