Closed brittle123 closed 3 years ago
I see you change package name to "com.virtoxed.imageeditlibrary.editimage.fliter.PhotoProcessing.nativeInitBitmap"
fliter implements with jni shoud find my pachage "com.xinlan.imageedit..." (C/C++ method name)
so you can not change this package (for filter method)
Sir how can i fix it then? i've to change its package name naa when i've to use it for my own.
Two solution
And at the end it's also showing the toast of save error. I think this is also because of change package name! Isn't it?
And at the end it's also showing the toast of save error. I think this is also because of change package name! Isn't it?
This question has nothing to do with package name
Sir i've used your 2nd option in which i only used your PhotoProcessing.java file, when i'm clicking on filter option now i'm getting this error.
E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
Process: com.virtoxed.bgeraser, PID: 28880
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:309)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.virtoxed.bgeraser-2/base.apk"],nativeLibraryDirectories=[/data/app/com.virtoxed.bgeraser-2/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libphotoprocessing.so"
at java.lang.Runtime.loadLibrary(Runtime.java:367)
at java.lang.System.loadLibrary(System.java:1076)
at com.virtoxed.bgeraser.editor.editimage.filter.PhotoProcessing.
Did you copy "jniLibs/ " so file to your project?
Are you asking me about these files?
i've added your jni folder to my project but it's not working for me.
jniLibs/photoprocessing.so file
Two solution
- recompile to make new _.so file with ndk change imageeditlibrary/jni/photoprocessing.c replace "com.xinlan." => your package name ;
- only copy file PhotoProcessing.java (no change package!!) to your project, Use PhotoProcessing.java when you need fliter.
@siwangqishiq I am quite new in android .. can you please explain the solution 1 that you suggested in detail ? my questions are: 1)where can I find the ndk? and what to change in it? 2)what to change in this file "imageeditlibrary/jni/photo_processing.c" ? 3)and at the end you asked to change the package name, is it in the build.gradle or somewhere else also?
Two solution
- recompile to make new _.so file with ndk change imageeditlibrary/jni/photoprocessing.c replace "com.xinlan." => your package name ;
- only copy file PhotoProcessing.java (no change package!!) to your project, Use PhotoProcessing.java when you need fliter.
@siwangqishiq I am quite new in android .. can you please explain the solution 1 that you suggested in detail ? my questions are: 1)where can I find the ndk? and what to change in it? 2)what to change in this file "imageeditlibrary/jni/photo_processing.c" ? 3)and at the end you asked to change the package name, is it in the build.gradle or somewhere else also?
1) https://developer.android.com/ndk/guides#download-ndk command "ndk-build " in your project 2) imageeditlibrary/jni/photo_processing.c change C function name "java_com_xinlan_xxx " => "java_com_yourpackage_xxx" 3) no need
Sir i've tried everything but can't add jni libs correctly,.. please can you show me your build.gradle file in which you've added your ndk and jni path.
--->I downloaded your project. --->Changed package name of demo module from com.xinlan.bgeraser to com.virtoxed.backgrounderaser which automatically changed the package name of imageditlibrary module from com.xinlan.imageeditlibrary to com.virtoxed.imageeditlibrary. --->Changed package of your photo_processing.c functions from Java_com_xinlan_imageeditlibrary_editimage... to Java_com_virtoxed_imageeditlibrary_editimage... --->Exactly don't know from where to add armeabi files in your jniLibs folder but i added these files from this path "imageeditlibrary\build\intermediates\library_jni\debug\jni"
And after that it still giving me the error of unsatisfiedlink
Where are you from?
------------------ 原始邮件 ------------------ 发件人: "siwangqishiq/ImageEditor-Android" @.>; 发送时间: 2021年6月24日(星期四) 下午4:39 @.>; @.>;"State @.>; 主题: Re: [siwangqishiq/ImageEditor-Android] Filters Isuue (#98)
Sir please help me to solve this issue,.. it's really important for me. If you can add these files correctly for me i'll send my project to you.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.
Fom Pakistan Sir.
Are you compile c/c++ code in jni (using ndk)?
------------------ 原始邮件 ------------------ 发件人: "siwangqishiq/ImageEditor-Android" @.>; 发送时间: 2021年6月24日(星期四) 下午5:01 @.>; @.>;"State @.>; 主题: Re: [siwangqishiq/ImageEditor-Android] Filters Isuue (#98)
Fom Pakistan Sir.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.
yes, 1)I have downloaded the ndk, configured it with jni/android.mk .. 2) changed the function names from "com.xinlan." to "com.virtoxed" in photo_processing.c as you said .. 3) than I Build that project with that new ndk change, .so files are generated in these directories: "imageeditlibrary/build/intermediates/library_jni", "imageeditlibrary/build/intermediates/merged_native_libs", "imageeditlibrary/build/intermediates/merged_jni_libs", "imageeditlibrary/build/intermediates/ndkBuild" 4) tried all these .so files one by one by copying them in jniLibs directroy in "imageeditlibrary/main/src/jniLibs", synced and rebuild the project ..
still not working and throwing the UnsatisfiedLink Error ...
can you run command "ndk-build " to generator new so file?
------------------ 原始邮件 ------------------ 发件人: "siwangqishiq/ImageEditor-Android" @.>; 发送时间: 2021年6月24日(星期四) 下午5:13 @.>; @.>;"State @.>; 主题: Re: [siwangqishiq/ImageEditor-Android] Filters Isuue (#98)
yes, 1)I have downloaded the ndk, configured it with jni/android.mk .. 2) changed the function names from "com.xinlan." to "com.virtoxed" in photo_processing.c as you said .. 3) than I Build that project with that new ndk change, .so files are generated in these directories: "imageeditlibrary/build/intermediates/library_jni", "imageeditlibrary/build/intermediates/merged_native_libs", "imageeditlibrary/build/intermediates/merged_jni_libs", "imageeditlibrary/build/intermediates/ndkBuild" 4) tried all these .so files one by one by copying them in jniLibs directroy in "imageeditlibrary/main/src/jniLibs", synced and rebuild the project ..
still not working and throwing the UnsatisfiedLink Error ...
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.
solved,.. Thanks.
Hello Sir !,.. I'm getting this error when clicking on any filter option. Please help me to resolve it ASAP! Regards & Thanks.
Caused by: java.lang.UnsatisfiedLinkError: No implementation found for int com.virtoxed.imageeditlibrary.editimage.fliter.PhotoProcessing.nativeInitBitmap(int, int) (tried Java_com_virtoxed_imageeditlibrary_editimage_fliter_PhotoProcessing_nativeInitBitmap and Java_com_virtoxed_imageeditlibrary_editimage_fliter_PhotoProcessing_nativeInitBitmap__II) at com.virtoxed.imageeditlibrary.editimage.fliter.PhotoProcessing.nativeInitBitmap(Native Method) at com.virtoxed.imageeditlibrary.editimage.fliter.PhotoProcessing.sendBitmapToNative(PhotoProcessing.java:138) at com.virtoxed.imageeditlibrary.editimage.fliter.PhotoProcessing.filterPhoto(PhotoProcessing.java:21) at com.virtoxed.imageeditlibrary.editimage.fragment.FilterListFragment$ProcessingImage.doInBackground(FilterListFragment.java:186) at com.virtoxed.imageeditlibrary.editimage.fragment.FilterListFragment$ProcessingImage.doInBackground(FilterListFragment.java:173) at android.os.AsyncTask$2.call(AsyncTask.java:333) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764)