重命名包破JNI功能Android工作室

时间:2017-12-18 03:11:27

标签: java android-studio opencv java-native-interface

我正在使用openCV并且它工作正常,直到我更改了包名称。我搜索了google和stackoverflow但没有任何结果。 这是一天,我很沮丧。 这是日志猫。 任何帮助将不胜感激。

12-18 08:37:24.328 12081-12144/in.indilabz.in.cbxprint E/art: No implementation found for void in.indilabz.in.cbxprint.editor.filter.PhotoProcessing.nativeApplyFilter(int, int, long, long) (tried Java_in_indilabz_in_cbxprint_editor_filter_PhotoProcessing_nativeApplyFilter and Java_in_indilabz_in_cbxprint_editor_filter_PhotoProcessing_nativeApplyFilter__IIJJ)
12-18 08:37:24.333 12081-12144/in.indilabz.in.cbxprint E/UncaughtException: java.lang.RuntimeException: An error occured while executing doInBackground()
                                    at android.os.AsyncTask$3.done(AsyncTask.java:304)
                                    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
                                    at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
                                    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
                                    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
                                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                                    at java.lang.Thread.run(Thread.java:818)
                                Caused by: java.lang.UnsatisfiedLinkError: No implementation found for void in.indilabz.in.cbxprint.editor.filter.PhotoProcessing.nativeApplyFilter(int, int, long, long) (tried Java_in_indilabz_in_cbxprint_editor_filter_PhotoProcessing_nativeApplyFilter and Java_in_indilabz_in_cbxprint_editor_filter_PhotoProcessing_nativeApplyFilter__IIJJ)
                                    at in.indilabz.in.cbxprint.editor.filter.PhotoProcessing.nativeApplyFilter(Native Method)
                                    at in.indilabz.in.cbxprint.editor.filter.PhotoProcessing.processImage(PhotoProcessing.java:26)
                                    at in.indilabz.in.cbxprint.editor.fragment.RecyclerMenuFragment$GetFilterThumbsTask.doInBackground(RecyclerMenuFragment.java:144)
                                    at in.indilabz.in.cbxprint.editor.fragment.RecyclerMenuFragment$GetFilterThumbsTask.doInBackground(RecyclerMenuFragment.java:134)
                                    at android.os.AsyncTask$2.call(AsyncTask.java:292)
                                    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) 
                                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
                                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
                                    at java.lang.Thread.run(Thread.java:818) 
12-18 08:37:24.459 696-714/? E/SensorService: activeConnections...
12-18 08:37:24.459 696-714/? E/SensorService: activeConnections...
12-18 08:37:24.625 12081-12144/in.indilabz.in.cbxprint E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
                                Process: in.indilabz.in.cbxprint, PID: 12081
                                java.lang.RuntimeException: An error occured while executing doInBackground()
                                    at android.os.AsyncTask$3.done(AsyncTask.java:304)
                                    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
                                    at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
                                    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
                                    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
                                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                                    at java.lang.Thread.run(Thread.java:818)
                                Caused by: java.lang.UnsatisfiedLinkError: No implementation found for void in.indilabz.in.cbxprint.editor.filter.PhotoProcessing.nativeApplyFilter(int, int, long, long) (tried Java_in_indilabz_in_cbxprint_editor_filter_PhotoProcessing_nativeApplyFilter and Java_in_indilabz_in_cbxprint_editor_filter_PhotoProcessing_nativeApplyFilter__IIJJ)
                                    at in.indilabz.in.cbxprint.editor.filter.PhotoProcessing.nativeApplyFilter(Native Method)
                                    at in.indilabz.in.cbxprint.editor.filter.PhotoProcessing.processImage(PhotoProcessing.java:26)
                                    at in.indilabz.in.cbxprint.editor.fragment.RecyclerMenuFragment$GetFilterThumbsTask.doInBackground(RecyclerMenuFragment.java:144)
                                    at in.indilabz.in.cbxprint.editor.fragment.RecyclerMenuFragment$GetFilterThumbsTask.doInBackground(RecyclerMenuFragment.java:134)
                                    at android.os.AsyncTask$2.call(AsyncTask.java:292)
                                    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) 
                                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
                                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
                                    at java.lang.Thread.run(Thread.java:818) 

1 个答案:

答案 0 :(得分:1)

根据@ lockcmpxchg8b的评论,我去寻找javah&的引用。找到了this article,我找到了答案。

要解决此问题,您需要检查make文件(可能在app/src/main/jni/Android.mk之类的地方)。它应包含LOCAL_MODULELOCAL_CFLAGS和& LOCAL_SRC_FILES

LOCAL_SRC_FILES会列出一些.cpp文件。在其中一个名称为Java_old_package_name_editor_filter_PhotoProcessing_nativeApplyFilter&的文件中查找功能。将old_package_name更改为新的包。