1

I've been trying to use this bluetooth library to make connection to a little bluetooth module easier. Problem is, when I change my MainActivity from extends AppCompatActivity to extends BluetoothActivity as shown in the example, my app consistently crashes. I've narrowed it down to only this - I can leave all of the abstract functions blank or in their original forms, and it still crashes. Not really sure what to do here.

Could it have to do with versions? It seems to be a memory error, but the abstract methods don't interfere with any of the other objects in the activity.

Edit: Additionally, I do have

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

in my AndroidManifest.xml

Crash log:

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
user6191359
  • 69
  • 1
  • 9

1 Answers1

0

try this , add following lines in proguard-project.txt

    # Only required if you use AsyncExecutor 

-keepclassmembers class * extends de.greenrobot.event.util.ThrowableFailureEvent { *; }
USKMobility
  • 5,721
  • 2
  • 27
  • 34