安卓ZBar例外只有詹金斯构建 [英] Android ZBar Exception only with Jenkins build
问题描述
我有一个QR扫描活动的Android项目。我用的是ZBar库这样的: http://sourceforge.net/projects/zbar/files/ AndroidSDK /
I have an android project with a QR scan activity. I use the ZBar library for this: http://sourceforge.net/projects/zbar/files/AndroidSDK/
如果该项目是建立在PC或Mac exlipse上,应用程序工作正常。 如果它是建立詹金斯(从Git的同一片源)应用程序崩溃。
If the project is built on a PC or Mac with exlipse, the app works fine. If it's build by jenkins (same source from git) the app crashes.
我得到的例外是:
at controller.gui.activity.QRScanActivity.onCreate(Unknown Source)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
at android.app.ActivityThread.access$600(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NoSuchFieldError: no field with name='peer' signature='J' in class Lnet/sourceforge/zbar/ImageScanner;
at net.sourceforge.zbar.ImageScanner.init(Native Method)
at net.sourceforge.zbar.ImageScanner.<clinit>(Unknown Source)
... 16 more
我用的演示应用程序的基础。
I used the demo app for a base.
这是一个詹金斯配置问题?
Is this a Jenkins config problem?
该Zbar图书馆不仅仅是一个jar文件,这是一个C语言库用JNI。所以,我有一个jar文件和3个文件夹(对于不同的架构,我认为),他们有一个libiconv.so和libzbarjni.so文件。
The Zbar library is not just a jar file, it's a C library with jni. So I have a jar file and 3 folders (for different architectures I think) and they have a libiconv.so and a libzbarjni.so files.
推荐答案
添加 -keep类net.sourceforge.zbar ** {*。 }
您的ProGuard配置文件
Add -keep class net.sourceforge.zbar.** { *; }
to your proguard config file
这篇关于安卓ZBar例外只有詹金斯构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!