I am developing an application in which I am using Estimote SDK for the Beacons. I have successfully added the Jars into my project and also used BeaconManager class to check for the status of the Bluetooth of the Device. Now whenever I am launching my application its crashing every time.
Following is my code with the logcat I am getting when the app is crashing :-
Toast.makeText(this, "Checking Bluetooth Status", Toast.LENGTH_LONG).show();
if (!beaconManager.hasBluetooth()) {
Toast.makeText(this, "Device does not have Bluetooth Low Energy", Toast.LENGTH_LONG).show();
return;
}
// If Bluetooth is not enabled, let user enable it.
if (!beaconManager.isBluetoothEnabled()) {
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
} else {
//connectToService();
Toast.makeText(mContext, " "+"Start Searching for Beacons", 0).show();
}
and the Logcat is :-
01-23 12:54:15.629: E/dalvikvm(24896): Could not find class 'com.estimote.sdk.BeaconManager', referenced from method com.example.beaconproject.HomeScreen.onCreate
01-23 12:54:15.769: E/AndroidRuntime(24896): FATAL EXCEPTION: main
01-23 12:54:15.769: E/AndroidRuntime(24896): java.lang.NoClassDefFoundError: com.estimote.sdk.BeaconManager
01-23 12:54:15.769: E/AndroidRuntime(24896): at com.example.beaconproject.HomeScreen.onCreate(HomeScreen.java:24)
01-23 12:54:15.769: E/AndroidRuntime(24896): at android.app.Activity.performCreate(Activity.java:5372)
01-23 12:54:15.769: E/AndroidRuntime(24896): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
01-23 12:54:15.769: E/AndroidRuntime(24896): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2257)
01-23 12:54:15.769: E/AndroidRuntime(24896): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349)
01-23 12:54:15.769: E/AndroidRuntime(24896): at android.app.ActivityThread.access$700(ActivityThread.java:159)
01-23 12:54:15.769: E/AndroidRuntime(24896): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
01-23 12:54:15.769: E/AndroidRuntime(24896): at android.os.Handler.dispatchMessage(Handler.java:99)
01-23 12:54:15.769: E/AndroidRuntime(24896): at android.os.Looper.loop(Looper.java:176)
01-23 12:54:15.769: E/AndroidRuntime(24896): at android.app.ActivityThread.main(ActivityThread.java:5419)
01-23 12:54:15.769: E/AndroidRuntime(24896): at java.lang.reflect.Method.invokeNative(Native Method)
01-23 12:54:15.769: E/AndroidRuntime(24896): at java.lang.reflect.Method.invoke(Method.java:525)
01-23 12:54:15.769: E/AndroidRuntime(24896): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
01-23 12:54:15.769: E/AndroidRuntime(24896): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
01-23 12:54:15.769: E/AndroidRuntime(24896): at dalvik.system.NativeStart.main(Native Method)
And my Manifest File is as follows :-
<uses-sdk
android:minSdkVersion="18"
android:targetSdkVersion="21" />
<!-- Needed permissions in order to scan for beacons. -->
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<!-- Declaration that this app is usable on phones with Bluetooth Low Energy. -->
<uses-feature
android:name="android.hardware.bluetooth_le"
android:required="true" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".HomeScreen"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name="com.estimote.sdk.service.BeaconService"
android:exported="false" />
Can anyone help me to sort out this. Any help would be appreciable. Thanks.