-3

I want to create an android app and I need an external SDK which I added to my project according to this answer: https://stackoverflow.com/a/30726911/4276486

In the picture below you can see that the packages in the external .jar cannot be resolved. However, when I am typing the IDE does autocomplete the package names but complains afterwards that the package cannot be resolved.

enter image description here

Any ideas how to fix this issue?


My gradle build file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "dhbw.naorobotapp"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile project(':java-naoqi-sdk-2.1.4.13-win32-vs2010')
}
2

1 Answer 1

7

Add this in your app gradle under dependencies, after you paste the .jar file under /libs

compile files('libs/<your jar filename>.jar')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.