不重复另一个问题,因为.gradle文件已按照建议进行配置。(注意,不是我无法构建项目,而是 IDE 无法识别导入)
安卓开发新手
我正在使用最新的 android studio (v3.1.3)
我从一个站点下载了源代码并尝试在 android 设备上运行它,这是成功的,即我可以构建 apk 但在 android studio IDE 中,导入类显示错误,该类似乎是从aar文件导入的。
如何在 IDE 中进行导入工作(不显示错误)?
这是build.gradle应用程序内:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.0"
defaultConfig {
applicationId "com.tencent.tmgp.yybtestsdk"
minSdkVersion 14
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile(name: 'YSDK_Android_1.3.9_917', ext: 'aar')
}
这是build.gradle项目
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
flatDir {
dirs 'libs'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}