2015-01-22 11 views
0

나는 비콘 용 Estimote SDK를 사용하는 응용 프로그램을 개발 중입니다. Jars를 프로젝트에 성공적으로 추가했으며 BeaconManager 클래스를 사용하여 장치의 Bluetooth 상태를 확인했습니다. 이제는 언제든지 내 응용 프로그램을 시작할 때마다 충돌이 발생합니다. 다음클래스가 없습니다. BeaconManager를 사용하는 중 오류가 발생했습니다.

응용 프로그램이 충돌 할 때 나는 점점 오전 로그 캣 내 코드입니다 : -

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(); 
     } 
과 로그 캣은 다음과 같습니다 -

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) 

그리고 다음과 같이 내 매니페스트 파일은 다음과 같습니다 -

<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" /> 

누구든지 나를 분류 할 수 있습니까? 어떤 도움을받을 수 있습니다. 감사합니다. .

+0

'eclipse'를 사용한다면'jars'에'add to path'를 했습니까? – hrskrs

+0

예 Eclipse 만 사용하고 있으며이 작업을 수행했습니다. –

+0

프로젝트에 Estimote sdk library를 어떻게 추가하고 있습니까? 외부 jar, libs 폴더 내부, 외부 라이브러리 프로젝트 ..? –

답변

1

Eclipse는 프로젝트를 제대로 가져올 수 없습니다. 올바르게 수행하는 방법은 this tutorial을 참조하십시오.

+0

나는 이클립스 만 때문이라고 생각한다. 감사 –