当前位置: 动力学知识库 > 问答 > 编程问答 >

java - Android Studio package in external jar cannot be resolved

问题描述:

I want to create an android app and I need an external SDK which I added to my project according to this answer: http://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.

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

}

网友答案:

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

compile files('libs/<your jar filename>.jar')
分享给朋友:
您可能感兴趣的文章:
随机阅读: