rograurding使用Javacv给人异常的Andr​​oi

rograurding使用Javacv给人异常的Andr​​oi

本文介绍了Prograurding使用Javacv给人异常的Andr​​oid项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好我发展与Javacv的应用程序。直到我ProGuard的构建应用程序工作正常。 proguarding后,应用程序崩溃的JNI调用函数的地方。

Hi i am developing an app with Javacv. The app works fine until i proguard the build. After proguarding, the app crashes at the place of jni function call.

-dontshrink
-dontoptimize
-dontpreverify

-dontwarn android.support.**

-keep class com.googlecode.javacv.**
-dontwarn com.googlecode.javacv.**

-keep class com.googlecode.javacpp.**
-dontwarn com.googlecode.javacpp.**

-keepclasseswithmembernames class * {
    native <methods>;
}

-keepattributes *Annotation*

我无法找到解决我的问题任何回答。我得到的NoSuchMethodError。任何人帮助我​​。我使用的是最新版本的Javacv库。

I can't find any answer that solves my problem. I am getting NoSuchMethodError. Anybody help me. I am using the latest version of Javacv library.

推荐答案

您必须保持你的本地方法(你已经做),以及来自本地code称为Java方法。

You have to keep your native methods (which you're already doing), as well as the Java methods called from native code.

您可以保留所有javacv和javacpp方法,像这样:

You can keep all javacv and javacpp methods like so:

-keep class com.googlecode.javacv.**{ *; }
-keepclassmembers class com.googlecode.javacv.** {
    <methods>;
}
-keep class com.googlecode.javacpp.**{ *; }
-keepclassmembers class com.googlecode.javacpp.** {
    <methods>;
}

另外,如果你想减少生成输出警告:

Also, if you want to cut down on warnings in the build output:

-dontwarn com.googlecode.javacv.**, com.googlecode.javacpp.**
-dontnote com.googlecode.javacv.**, com.googlecode.javacpp.**

这篇关于Prograurding使用Javacv给人异常的Andr​​oid项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 14:42