Android Studio package eroor

Hi,
I have the following problem:
1. I downloaded the API from here: https://github.com/mbientlab/Metawear-AndroidAPI
2. I did everything from this video .  At the end i received build successful.
3. I downloaded the Android sample app from here: https://github.com/mbientlab/Metawear-SampleAndroidApp
4. I changed the project.properties file as follows :
"target=android-21
android.library.reference.1= C\:\\Users\\Razvan\\AndroidStudioProjects\\MetaWearAPI "
5. I imported the Android sample app into android studio.
6. I hit run and I got the following error:
".............
Error:(54, 1) error: package com.mbientlab.metawear.api.controller.Accelerometer does not exist
Error:(55, 74) error: package com.mbientlab.metawear.api.controller.Accelerometer.SamplingConfig does not exist
Error:(56, 74) error: package com.mbientlab.metawear.api.controller.Accelerometer.SamplingConfig does not exist
Error:(57, 45) error: package com.mbientlab.metawear.api.controller does not exist
Error:(58, 39) error: package com.mbientlab.metawear.api.util does not exist
Error:(59, 39) error: package com.mbientlab.metawear.api.util does not exist
.............
"
What do I do wrong?

Thanks,
Neno

Comments

  • edited March 2015
    Make sure the compile dependency references the correct project and the target/source jdk are set to 1.7
  • I went to Project structure and there i selected 1.7 for target/source.
    My dependencies are

    dependencies {
        compile project(':metaWearAPI')
        compile 'com.android.support:support-v4:19.1.0'
        compile files('libs/GraphView-3.1.3.jar')
        compile files('libs/nrf-logger-v1.2.jar')
    }
    Do I have to change something here?
    Did anybody imported the sample app in Android studio?
  • It appears that the api project isn't linked to the app.  The folder structures should be:

    MetaWearApp/
    +___metaWearAPI/
    +___metaWearApp/
    -___build.gradle

    Unless you are going to be playing with the API source code, you should use one of the published API artifacts as outlined on our docs page:

    http://docs.mbientlab.com/?page_id=40#post-73


This discussion has been closed.