Android Studio - Estimote SDK - Could not find class
Asked Answered
H

0

6

I'm building an app using the Estimote Android SDK & Android Studio. I have added the estimote-sdk-preview.jar to my libs folder, and the IDE recognises it (no errors in any of my .java files) but when it gets uploaded to my HTC One I get the following errors in logcat and I get the "Sorry this app has crashed" message on my phone:

...
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>
...

I have tried going to Project Structure and addding the library through that, in my gradle properties I have:

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'
}

Here's the beginning of my .java file:

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();
        }
    }

So I'm pretty stumped, can anyone help me?

Halftimbered answered 6/5, 2014 at 18:0 Comment(6)
Are you using proguard on this project?Hixson
Hi Vitor, no I'm not!Halftimbered
I had similar errors with proguard changing some class and method names. If it's not that, I guess it would be a problem with the estimote-sdk-preview.jar or your project setup, but I can't really be of further assistance. Good luck solving this.Hixson
When you pasted the library into your project, did you right click > 'add as library' on it?Amery
@freshnode Have you solved this issue?Zigrang
try to create the BeaconManager instance in onCreate scope instead of make the new BeaconManager(this); at class scope...Faggot

© 2022 - 2024 — McMap. All rights reserved.