蓝牙库崩溃的应用程序

时间:2016-05-11 04:14:52

标签: android bluetooth

我一直在尝试使用this蓝牙库来更轻松地连接到一个小蓝牙模块。问题是,当我将MainActivityextends AppCompatActivity更改为extends BluetoothActivity时,如示例所示,我的应用始终崩溃。我把它缩小到只有这个 - 我可以将所有的抽象函数留空或以原始形式存在,它仍然会崩溃。不知道该怎么做。

可能与版本有关吗?它似乎是一个内存错误,但抽象方法不会干扰活动中的任何其他对象。

编辑:此外,我确实有

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

在我的AndroidManifest.xml

崩溃日志:

05-10 22:17:37.862 18350-18350/? E/Zygote: v2
05-10 22:17:37.862 18350-18350/? I/libpersona: KNOX_SDCARD checking this for 10010
05-10 22:17:37.862 18350-18350/? I/libpersona: KNOX_SDCARD not a persona
05-10 22:17:37.862 18350-18350/? W/SELinux: Function: selinux_compare_spd_ram, index[1], priority [2], priority version is VE=SEPF_SECMOBILE_6.0.1_0004
05-10 22:17:37.862 18350-18350/? E/Zygote: accessInfo : 0
05-10 22:17:37.862 18350-18350/? W/SELinux: SELinux: seapp_context_lookup: seinfo=default, level=s0:c512,c768, pkgname=com.start.user.calculator 
05-10 22:17:37.862 18350-18350/? I/art: Late-enabling -Xcheck:jni
05-10 22:17:37.882 18350-18350/? D/TimaKeyStoreProvider: TimaSignature is unavailable
05-10 22:17:37.882 18350-18350/? D/ActivityThread: Added TimaKeyStore provider
05-10 22:17:37.912 18350-18350/? W/ResourcesManager: getTopLevelResources: /data/app/com.start.user.calculator-1/base.apk / 1.0 running in com.start.user.calculator rsrc of package com.start.user.calculator
05-10 22:17:37.912 18350-18350/? I/InjectionManager: Inside getClassLibPath + mLibMap{0=, 1=}
05-10 22:17:37.912 18350-18350/? D/ResourcesManager: For user 0 new overlays fetched Null
05-10 22:17:37.922 18350-18350/? W/ActivityThread: Application com.start.user.calculator is waiting for the debugger on port 8100...
05-10 22:17:37.922 18350-18350/? I/System.out: Sending WAIT chunk
05-10 22:17:40.252 18350-18356/com.start.user.calculator I/art: Debugger is active
05-10 22:17:40.322 18350-18350/com.start.user.calculator I/System.out: Debugger has connected
05-10 22:17:40.322 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:40.522 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:40.722 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:40.922 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:41.122 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:41.322 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:41.522 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:41.722 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:41.922 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:42.122 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:42.322 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:42.522 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:42.722 18350-18350/com.start.user.calculator I/System.out: waiting for debugger to settle...
05-10 22:17:42.922 18350-18350/com.start.user.calculator I/System.out: debugger has settled (1379)
05-10 22:17:42.932 18350-18350/com.start.user.calculator I/InjectionManager: Inside getClassLibPath caller 
05-10 22:17:42.942 18350-18350/com.start.user.calculator W/System: ClassLoader referenced unknown path: /data/app/com.start.user.calculator-1/lib/arm64
05-10 22:17:42.952 18350-18350/com.start.user.calculator D/Minikin: FontFamily bestFont == NULL, so return vacant FakedFont
05-10 22:17:42.952 18350-18350/com.start.user.calculator D/Minikin: FontFamily bestFont == NULL, so return vacant FakedFont
05-10 22:17:42.952 18350-18350/com.start.user.calculator D/Minikin: FontFamily bestFont == NULL, so return vacant FakedFont
05-10 22:17:42.962 18350-18350/com.start.user.calculator D/Minikin: FontFamily bestFont == NULL, so return vacant FakedFont
05-10 22:17:42.962 18350-18350/com.start.user.calculator D/Minikin: FontFamily bestFont == NULL, so return vacant FakedFont
05-10 22:17:42.962 18350-18350/com.start.user.calculator D/Minikin: FontFamily bestFont == NULL, so return vacant FakedFont
05-10 22:17:42.962 18350-18350/com.start.user.calculator D/InjectionManager: InjectionManager
05-10 22:17:42.962 18350-18350/com.start.user.calculator D/InjectionManager: fillFeatureStoreMap com.start.user.calculator
05-10 22:17:42.962 18350-18350/com.start.user.calculator I/InjectionManager: Constructor com.start.user.calculator, Feature store :{}
05-10 22:17:42.962 18350-18350/com.start.user.calculator I/InjectionManager: featureStore :{}
05-10 22:17:42.992 18350-18350/com.start.user.calculator W/ResourcesManager: getTopLevelResources: /data/app/com.start.user.calculator-1/base.apk / 1.0 running in com.start.user.calculator rsrc of package com.start.user.calculator
05-10 22:17:43.002 18350-18350/com.start.user.calculator W/ResourcesManager: getTopLevelResources: /data/app/com.start.user.calculator-1/base.apk / 1.0 running in com.start.user.calculator rsrc of package com.start.user.calculator
05-10 22:17:43.162 18350-18350/com.start.user.calculator D/Activity: performCreate Call Injection manager
05-10 22:17:43.172 18350-18350/com.start.user.calculator D/AndroidRuntime: Shutting down VM
05-10 22:17:43.172 18350-18350/com.start.user.calculator E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                 Process: com.start.user.calculator, PID: 18350
                                                                                 java.lang.NoClassDefFoundError: Failed resolution of: Lde/greenrobot/event/EventBus;
                                                                                     at com.ramimartin.bluetooth.activity.BluetoothActivity.onStart(BluetoothActivity.java:37)
                                                                                     at com.start.user.calculator.OnlyActivity.onStart(OnlyActivity.java:314)
                                                                                     at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1265)
                                                                                     at android.app.Activity.performStart(Activity.java:6915)
                                                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3217)
                                                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350)
                                                                                     at android.app.ActivityThread.access$1100(ActivityThread.java:222)
                                                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
                                                                                     at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                     at android.os.Looper.loop(Looper.java:158)
                                                                                     at android.app.ActivityThread.main(ActivityThread.java:7229)
                                                                                     at java.lang.reflect.Method.invoke(Native Method)
                                                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
                                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
                                                                                  Caused by: java.lang.ClassNotFoundException: Didn't find class "de.greenrobot.event.EventBus" on path: DexPathList[[zip file "/data/app/com.start.user.calculator-1/base.apk"],nativeLibraryDirectories=[/data/app/com.start.user.calculator-1/lib/arm64, /vendor/lib64, /system/lib64]]
                                                                                     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                                                                                     at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
                                                                                     at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
                                                                                     at com.ramimartin.bluetooth.activity.BluetoothActivity.onStart(BluetoothActivity.java:37) 
                                                                                     at com.start.user.calculator.OnlyActivity.onStart(OnlyActivity.java:314) 
                                                                                     at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1265) 
                                                                                     at android.app.Activity.performStart(Activity.java:6915) 
                                                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3217) 
                                                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350) 
                                                                                     at android.app.ActivityThread.access$1100(ActivityThread.java:222) 
                                                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795) 
                                                                                     at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                     at android.os.Looper.loop(Looper.java:158) 
                                                                                     at android.app.ActivityThread.main(ActivityThread.java:7229) 
                                                                                     at java.lang.reflect.Method.invoke(Native Method) 
                                                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 
                                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 
                                                                                    Suppressed: java.lang.ClassNotFoundException: de.greenrobot.event.EventBus
                                                                                     at java.lang.Class.classForName(Native Method)
                                                                                     at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
                                                                                     at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
                                                                                     at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
                                                                                            ... 15 more
                                                                                  Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
05-10 22:18:11.802 18350-18350/com.start.user.calculator I/Process: Sending signal. PID: 18350 SIG: 9

1 个答案:

答案 0 :(得分:0)

试试这个,在proguard-project.txt中添加以下行

    # Only required if you use AsyncExecutor 

-keepclassmembers class * extends de.greenrobot.event.util.ThrowableFailureEvent { *; }