Nep*_*eph 3 java import android android-support-library android-studio
AndroidStudio让我再次疯狂......我从Win 7 PC上获得了一个一年的AS项目(工作得很好)并想在我的Win 10工作站上添加东西,但即使AS说构建成功完成,它不会解决几个导入,导致大量的红色波浪线:
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
Run Code Online (Sandbox Code Playgroud)
是的,在"build.gradle"文件中有一个Maven条目,它直接位于项目文件夹中.
"app"gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.mycompany.myapp"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.+'
compile 'com.android.support:support-v4:23.0.3'
}
Run Code Online (Sandbox Code Playgroud)
第一个"编译"也有一条波浪线,消息说:
All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes).
Found versions 28.0.0-alpha1, 23.4.0.
Run Code Online (Sandbox Code Playgroud)
如果我使用"compile'com.android.support:support-v4:28.0.0-alpha1'",则构建在":app:processDebugResources"处失败并且它会抱怨:
AAPT2 error: check logs for details
Run Code Online (Sandbox Code Playgroud)
日志以:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:processDebugResources'.
Run Code Online (Sandbox Code Playgroud)
AS究竟想要什么(除了让我神经紧张)?
| 归档时间: |
|
| 查看次数: |
4831 次 |
| 最近记录: |