我正在使用Estimote Android SDK和Android Studio构建应用.我已将estimote-sdk-preview.jar添加到我的libs
文件夹中,并且IDE识别它(我的任何.java文件中没有错误)但是当它上传到我的HTC One时我在logcat中得到以下错误而且我得到了我手机上的"抱歉此应用已崩溃"消息:
... 05-06 18:55:44.662 23179-23179/com.freshnode.daze E/dalvikvm? Could not find class 'com.estimote.sdk.Region', referenced from method com.freshnode.daze.MainActivity.05-06 18:55:44.662 23179-23179/com.freshnode.daze E/dalvikvm? Could not find class 'com.estimote.sdk.BeaconManager', referenced from method com.freshnode.daze.MainActivity. ...
我试过去项目结构并通过它添加库,在我的gradle属性中我有:
dependencies { compile files('libs/estimote-sdk-preview.jar') compile 'com.android.support:gridlayout-v7:19.0.0' compile 'com.android.support:appcompat-v7:19.0.0' }
这是我的.java文件的开头:
public class MainActivity extends ActionBarActivity { 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); private BeaconManager beaconManager = new BeaconManager(this); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState == null) { getSupportFragmentManager().beginTransaction() .add(R.id.container, new PlaceholderFragment()) .commit(); } }
所以我很难过,任何人都可以帮助我吗?