1

난폭 한 비키에 간단한 앱을하려고하는데, 앱을 시작할 때 멈 춥니 다. 나는 "외부 항아리 추가"와 함께 sdk를 제대로 가져 왔다고 생각합니다. 이 오류 로그입니다Estimote/iBeacon 안드로이드에서 지역 클래스가 발견되지 않습니다.

<uses-permission android:name="android.permission.BLUETOOTH"/> 
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> 
... 
<service android:name="com.estimote.sdk.service.BeaconService" android:exported="false"/> 

내가 블루투스 권한과 다른 일을 할 수있는 안드로이드 매니페스트를 변경

sdk imported

은 ... :

02-25 13:25:45.431: E/dalvikvm(9326): Could not find class 'com.estimote.sdk.Region', referenced from method com.example.beacons.MainActivity.<clinit> 
02-25 13:25:45.431: W/dalvikvm(9326): VFY: unable to resolve new-instance 710 (Lcom/estimote/sdk/Region;) in Lcom/example/beacons/MainActivity; 
02-25 13:25:45.431: D/dalvikvm(9326): VFY: replacing opcode 0x22 at 0x0001 
02-25 13:25:45.431: D/dalvikvm(9326): DexOpt: unable to opt direct call 0x13b3 at 0x07 in Lcom/example/beacons/MainActivity;.<clinit> 
02-25 13:25:45.431: W/dalvikvm(9326): Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lcom/example/beacons/MainActivity; 
02-25 13:25:45.431: W/dalvikvm(9326): Class init failed in newInstance call (Lcom/example/beacons/MainActivity;) 
02-25 13:25:45.431: D/AndroidRuntime(9326): Shutting down VM 
02-25 13:25:45.431: W/dalvikvm(9326): threadid=1: thread exiting with uncaught exception (group=0x41599ba8) 
02-25 13:25:45.431: E/AndroidRuntime(9326): FATAL EXCEPTION: main 
02-25 13:25:45.431: E/AndroidRuntime(9326): Process: com.example.beacons, PID: 9326 
02-25 13:25:45.431: E/AndroidRuntime(9326): java.lang.NoClassDefFoundError: com.estimote.sdk.Region 
02-25 13:25:45.431: E/AndroidRuntime(9326):  at com.example.beacons.MainActivity.<clinit>(MainActivity.java:18) 
02-25 13:25:45.431: E/AndroidRuntime(9326):  at java.lang.Class.newInstanceImpl(Native Method) 
02-25 13:25:45.431: E/AndroidRuntime(9326):  at java.lang.Class.newInstance(Class.java:1208) 
02-25 13:25:45.431: E/AndroidRuntime(9326):  at android.app.Instrumentation.newActivity(Instrumentation.java:1061) 
02-25 13:25:45.431: E/AndroidRuntime(9326):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112) 
02-25 13:25:45.431: E/AndroidRuntime(9326):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 
02-25 13:25:45.431: E/AndroidRuntime(9326):  at android.app.ActivityThread.access$800(ActivityThread.java:135) 
02-25 13:25:45.431: E/AndroidRuntime(9326):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
02-25 13:25:45.431: E/AndroidRuntime(9326):  at android.os.Handler.dispatchMessage(Handler.java:102) 
02-25 13:25:45.431: E/AndroidRuntime(9326):  at android.os.Looper.loop(Looper.java:136) 
02-25 13:25:45.431: E/AndroidRuntime(9326):  at android.app.ActivityThread.main(ActivityThread.java:5017) 
02-25 13:25:45.431: E/AndroidRuntime(9326):  at java.lang.reflect.Method.invokeNative(Native Method) 
02-25 13:25:45.431: E/AndroidRuntime(9326):  at java.lang.reflect.Method.invoke(Method.java:515) 
02-25 13:25:45.431: E/AndroidRuntime(9326):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
02-25 13:25:45.431: E/AndroidRuntime(9326):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
02-25 13:25:45.431: E/AndroidRuntime(9326):  at dalvik.system.NativeStart.main(Native Method) 
02-25 13:30:45.704: I/Process(9326): Sending signal. PID: 9326 SIG: 9 

나는 이유를 모른다 클래스 'com.estimote.sdk.Region'을 찾을 수 없습니다.

private static final Region ALL_ESTIMOTE_BEACONS = new Region("regionId", ESTIMOTE_PROXIMITY_UUID, null, null); 

모두 잘 작동 내가 화면에있는 1 개 버튼을 터치 할 때 나는 토스트를 볼 수 있습니다 :이것은 주요 활동

package com.example.beacons; 

import java.util.List; 

import com.estimote.sdk.Beacon; 
import com.estimote.sdk.BeaconManager; 
import com.estimote.sdk.Region; 

import android.os.Bundle; 
import android.os.RemoteException; 
import android.app.Activity; 
import android.view.Menu; 
import android.view.View; 
import android.widget.Toast; 

public class MainActivity extends Activity { 
    private static final String ESTIMOTE_PROXIMITY_UUID = "B9407F30-F5F8-466E-AFF9-25556B57FE6D"; 
    private static final Region ALL_ESTIMOTE_BEACONS = new Region("regionId", ESTIMOTE_PROXIMITY_UUID, null, null); 

    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.activity_main); 
    } 

    @Override 
    public boolean onCreateOptionsMenu(Menu menu) { 
     // Inflate the menu; this adds items to the action bar if it is present. 
     getMenuInflater().inflate(R.menu.main, menu); 
     return true; 
    } 

    public void bluetoothTest(View view){ 
     Toast.makeText(getBaseContext(),"Listener works", Toast.LENGTH_SHORT).show(); 
    } 

} 

내가이 줄을 삭제하는 경우입니다.

답변

1

했다. 제 경우에는 이 Unity3D 및 견적 서비스와 함께있었습니다. 핵심은 UI가없는 조각을 currentActivity에 추가하는 것입니다.

예 : 비콘을 시작하는 파일에 있습니다. 이 예제가 하나의 프로젝트에서 유니티 프로젝트와 섞이도 록하기 때문에 유니티 플레이어의 현재 액티비티를 삭제할 수 있습니다.

fragment = new BeaconsFragment(); 
    android.app.FragmentManager fragmentManager = UnityPlayer.currentActivity.getFragmentManager(); 
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); 
    fragmentTransaction.add(fragment, "thread_beacons"); 
    fragmentTransaction.commit()