I wrote a little Hello World program using Android Studio. Minimal sdk API is 16. I installed the virtual device running on API 21 and the program works fine. I also tried to run the program on a Galaxy S5 with Android 6 Cell phone which works fine.
I then connected my phone (Galaxy S2 with Jelly Bean) and tried to run it on the phone. However it only closed the app and displayed program closed.
Here is the log shown by Android Studio
And this is the Module:app build.gradle file:
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'
}
The entire project directory can be found here.Any help on were I go wrong would be greatly appreciated.
Edit: I forgot to mention I'm using Android Studio 2.2 Prev 5 on Ubuntu 14.4
If you are using v1.5.0 or below of the Gradle plugin, you need the following code in your app’s build.gradle:
https://medium.com/@chrisbanes/appcompat-v23-2-age-of-the-vectors-91cbafa87c88#.njl8u0f91