Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find class/NoClassDefFoundError BeaconService while using SDK in remote service #25

Closed
Mtx88 opened this issue Feb 19, 2014 · 1 comment

Comments

@Mtx88
Copy link

Mtx88 commented Feb 19, 2014

Our application runs in a remote service.

Android Manifest File:

<service
            android:name="..."
            android:process=":remote" >
            <intent-filter>
                <action android:name="..." />
            </intent-filter>
</service>

I first added the BeaconService like this

<service android:name="com.estimote.sdk.service.BeaconService"
         android:exported="false"/>

But then I got the following error

02-19 12:42:19.923: E/dalvikvm(14751): Could not find class 'android.bluetooth.BluetoothManager', referenced from method com.estimote.sdk.BeaconManager.isBluetoothEnabled
02-19 12:42:19.983: E/dalvikvm(14751): Could not find class 'com.estimote.sdk.service.BeaconService$InternalLeScanCallback', referenced from method com.estimote.sdk.service.BeaconService.<init>
02-19 12:42:20.033: E/dalvikvm(14751): Could not find class 'android.bluetooth.BluetoothManager', referenced from method com.estimote.sdk.service.BeaconService.onCreate
02-19 12:42:20.038: E/AndroidRuntime(14751): FATAL EXCEPTION: main
02-19 12:42:20.038: E/AndroidRuntime(14751): java.lang.NoClassDefFoundError: com.estimote.sdk.service.BeaconService$InternalLeScanCallback
02-19 12:42:20.038: E/AndroidRuntime(14751):    at com.estimote.sdk.service.BeaconService.<init>(BeaconService.java:121)
02-19 12:42:20.038: E/AndroidRuntime(14751):    at java.lang.Class.newInstanceImpl(Native Method)
02-19 12:42:20.038: E/AndroidRuntime(14751):    at java.lang.Class.newInstance(Class.java:1319)
02-19 12:42:20.038: E/AndroidRuntime(14751):    at android.app.ActivityThread.handleCreateService(ActivityThread.java:2385)
02-19 12:42:20.038: E/AndroidRuntime(14751):    at android.app.ActivityThread.access$1600(ActivityThread.java:140)
02-19 12:42:20.038: E/AndroidRuntime(14751):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1309)
02-19 12:42:20.038: E/AndroidRuntime(14751):    at android.os.Handler.dispatchMessage(Handler.java:99)
02-19 12:42:20.038: E/AndroidRuntime(14751):    at android.os.Looper.loop(Looper.java:137)
02-19 12:42:20.038: E/AndroidRuntime(14751):    at android.app.ActivityThread.main(ActivityThread.java:4898)
02-19 12:42:20.038: E/AndroidRuntime(14751):    at java.lang.reflect.Method.invokeNative(Native Method)
02-19 12:42:20.038: E/AndroidRuntime(14751):    at java.lang.reflect.Method.invoke(Method.java:511)
02-19 12:42:20.038: E/AndroidRuntime(14751):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
02-19 12:42:20.038: E/AndroidRuntime(14751):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
02-19 12:42:20.038: E/AndroidRuntime(14751):    at dalvik.system.NativeStart.main(Native Method)

Looking for a solution I tried adding: android:process=":remote" to the BeaconService

<service android:name="com.estimote.sdk.service.BeaconService"
         android:process=":remote"
         android:exported="true"/>

This did fix the error and I was able to receive data from the listeners but for some reason this only works on my Nexus 5 which runs Android KitKat 4.4. This solution did NOT work on my Samsung S3 which runs on an older version of Android.

Jar path: libs\estimote-sdk-preview.jar

I understand that BLE only works on 4.3+ but should it just crash like that?

Any advice?

@wiktor
Copy link
Contributor

wiktor commented Feb 19, 2014

No, it should be more clear for the logs.

I'll leave it open to make sure that errors are more friendly when it runs on non 4.3+ device.

wiktor added a commit that referenced this issue Mar 18, 2014
 - CAN BREAK BUILD: MonitoringListener returns list of beacons the triggered enter region event (#18)
 - Better messaging when BeaconManager cannot start service to scan beacons (#25)
 - Fixed bug in SDK when other beacons are around (#27)
@wiktor wiktor closed this as completed Mar 18, 2014
jamesmontemagno added a commit to jamesmontemagno/Estimotes-Xamarin that referenced this issue Aug 7, 2014
0.4.2 (June 24, 2014):

Fixes Estimote/Android-Fleet-Management-SDK#55: it is safe to
use library from remote process
0.4.1 (March 18, 2014)

CAN BREAK BUILD: MonitoringListener returns list of beacons the
triggered enter region event
(Estimote/Android-Fleet-Management-SDK#18)
Better messaging when BeaconManager cannot start service to scan
beacons (Estimote/Android-Fleet-Management-SDK#25)
Fixed bug in SDK when other beacons are around
(Estimote/Android-Fleet-Management-SDK#27)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants