我Hello World
用Android Studio
. 最小的 sdk API 是 16。我安装了在 API 21 上运行的虚拟设备,程序运行良好。我还尝试在装有 Android 6 手机的 Galaxy S5 上运行该程序,效果很好。
然后我连接了我的手机(带有 Jelly Bean 的 Galaxy S2)并尝试在手机上运行它。但是它只关闭了应用程序并关闭了显示的程序。
这是 Module:app build.gradle 文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "magu.schwaderina"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:support-v4:24.0.0'
compile 'com.android.support:support-vector-drawable:24.0.0'
testCompile 'junit:junit:4.12'
}
整个项目目录可以在这里找到。如果我出错了,任何帮助将不胜感激。
编辑:我忘了提到我在 Ubuntu 14.4 上使用 Android Studio 2.2 Prev 5