6

我正在使用 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.<clinit>
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.<init>
...

我试图去项目结构并通过它添加库,在我的 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();
        }
    }

所以我很困惑,有人可以帮助我吗?

4

0 回答 0