Skip to content

Commit 81ca919

Browse files
author
pioner921227
committed
fix android
1 parent 12a2325 commit 81ca919

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

android/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
cmake_minimum_required(VERSION 3.4.1)
2-
project(saveimagetogallery)
2+
project(imgbuffersave)
33

44
set (CMAKE_VERBOSE_MAKEFILE ON)
55
set (CMAKE_CXX_STANDARD 17)
66

77

8-
add_library(saveimagetogallery SHARED
8+
add_library(imgbuffersave SHARED
99
cpp-adapter.cpp
1010
)
1111

@@ -15,7 +15,7 @@ find_package(ReactAndroid REQUIRED CONFIG)
1515
find_package(fbjni REQUIRED CONFIG)
1616

1717
target_include_directories(
18-
saveimagetogallery PRIVATE
18+
imgbuffersave PRIVATE
1919
"${NODE_MODULES_DIR}/react-native/React"
2020
"${NODE_MODULES_DIR}/react-native/React/Base"
2121
"${NODE_MODULES_DIR}/react-native/ReactCommon"
@@ -25,7 +25,7 @@ target_include_directories(
2525
"${NODE_MODULES_DIR}/react-native/ReactCommon/runtimeexecutor"
2626
)
2727

28-
target_link_libraries(saveimagetogallery
28+
target_link_libraries(imgbuffersave
2929
ReactAndroid::jsi
3030
log
3131
ReactAndroid::reactnative

android/src/main/java/com/imgbuffersave/ImgBufferSaveModule.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ import kotlinx.coroutines.CoroutineScope
1111
import kotlinx.coroutines.Dispatchers
1212
import kotlinx.coroutines.launch
1313

14-
@ReactModule(name = ImgBufferSaveModule.NAME)
15-
class ImgBufferSaveModule(reactContext: ReactApplicationContext) :
16-
NativeImgBufferSaveSpec(reactContext) {
14+
@OptIn(FrameworkAPI::class)
15+
class ImgBufferSaveModule internal constructor(val context: ReactApplicationContext) :
16+
ReactContextBaseJavaModule(context) {
1717

1818
companion object {
1919

2020
const val NAME = "ImgBufferSave"
2121

2222
init {
23-
System.loadLibrary("saveimagetogallery")
23+
System.loadLibrary("imgbuffersave")
2424
}
2525

26-
lateinit var instance: SaveImageToGalleryModule private set
26+
lateinit var instance: ImgBufferSaveModule private set
2727

2828

2929
@OptIn(FrameworkAPI::class)

0 commit comments

Comments
 (0)