0

I've downloaded Android Studio 3 canary 6. I created a project using the empty activity and targeted it to run on Android 4.0(Ice Cream Sandwitch) and above. When Running the app on the actual device that uses android Kitkat 4.4 (I've tried in two different devices) I get "unfortunally app stopped working". I didn't touch any of the code generated by the empty activity project. What can cause this issue?. Where do I start to look to solve this problem?. I'm reading a book and I followed all the steps so it should work.

updated

logcat:

    java.lang.RuntimeException: Unable to start activity ComponentInfo{br.com.example.teste03/br.com.example.teste03.MainActivity}: 
android.content.res.Resources$NotFoundException: Resource ID #0x7f060052
Diego Alves
  • 2,462
  • 3
  • 32
  • 65

2 Answers2

2

I recommend updating your android studio to the latest available version on the beta channel, Beta 4 is available right now

https://developer.android.com/studio/preview/index.html

Also need to check your gradle settings, you said you are targeting 4.0 and above, to target 4.0 and above you will need this on your app level gradle

    android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.test.helloworld"
        minSdkVersion 14
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
           }
        }
     }

Hope it helps

Andre Breton
  • 1,273
  • 1
  • 9
  • 19
-1

With the logcat information I found that adding

 android.enableAapt2=false 

to grade.properties solves the problem. I don't know why, I'm just start learning Android development.

Diego Alves
  • 2,462
  • 3
  • 32
  • 65