我刚刚迁移到新的 Ubuntu,因此安装了最新的 java 版本 8(或 1.8)。我还安装了Android Studio 0.5.7。但是,Dalvik 不支持 Java 8,不是吗?我想保留当前安装的 java 8,因为我要在 Java 项目中使用它,但我还必须安装 Java 7 才能在 Android 中使用它。正确的做法是什么?
更新:
错误:
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not find any version that matches com.android.support:appcompat-v7:+.
Required by:
MyApplication:app:unspecified
#app/build.grandle
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile fileTree(dir: 'libs', include: ['*.jar'])
}
最佳答案
错误
Could not find any version that matches com.android.support:appcompat-v7:+.
在 Android Studio could not find any version that matches com.android.support:appcompat-v7:+ 中得到答复
即在 SDK Manager 中安装/更新 Extras/Android 支持存储库以使用此依赖项。
关于java - 安装 Java 7 以及已安装的 Java 8 以便能够构建 Android 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23331629/