0

I am developing application for tablet target devices. I am using nexus 10 tab emulator which has the resolution as same as the tablet have.

It runs on emulator even it runs on my real mobile device but as I go to run in real tablet device it says 'Unfortunately Stopped'.

I am clueless about this error. Facing such error for 1st time.

Here is my Logcat:

09-22 14:53:47.662 8121-8121/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                 Process: com.noesis.bhurmalaidanmal, PID: 8121
                                                 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.noesis.bhurmalaidanmal/com.noesis.bhurmalaidanmal.MainActivity}: java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.
                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2198)
                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2247)
                                                     at android.app.ActivityThread.access$800(ActivityThread.java:139)
                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
                                                     at android.os.Handler.dispatchMessage(Handler.java:102)
                                                     at android.os.Looper.loop(Looper.java:136)
                                                     at android.app.ActivityThread.main(ActivityThread.java:5028)
                                                     at java.lang.reflect.Method.invokeNative(Native Method)
                                                     at java.lang.reflect.Method.invoke(Method.java:515)
                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:788)
                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:604)
                                                     at dalvik.system.NativeStart.main(Native Method)
                                                  Caused by: java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.
                                                     at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:720)
                                                     at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:187)
                                                     at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:77)
                                                     at android.support.v7.app.AppCompatDelegateImplBase.<init>(AppCompatDelegateImplBase.java:127)
                                                     at android.support.v7.app.AppCompatDelegateImplV9.<init>(AppCompatDelegateImplV9.java:147)
                                                     at android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:27)
                                                     at android.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:50)
                                                     at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:201)
                                                     at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:181)
                                                     at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:521)
                                                     at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)
                                                     at com.noesis.bhurmalaidanmal.MainActivity.onCreate(MainActivity.java:24)
                                                     at android.app.Activity.performCreate(Activity.java:5241)
                                                     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2162)
                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2247) 
                                                     at android.app.ActivityThread.access$800(ActivityThread.java:139) 
                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210) 
                                                     at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                     at android.os.Looper.loop(Looper.java:136) 
                                                     at android.app.ActivityThread.main(ActivityThread.java:5028) 
                                                     at java.lang.reflect.Method.invokeNative(Native Method) 
                                                     at java.lang.reflect.Method.invoke(Method.java:515) 

And this my build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.1"

    defaultConfig {
        applicationId "com.noesis.bhurmalaidanmal"
        minSdkVersion 9
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.0.1'
    compile 'com.android.support:design:24.2.0'
    compile 'com.ogaclejapan.smarttablayout:library:1.2.1@aar'

}

Please someone help me out of it. Your help will be greatly appreciated. Thanks.

Prashant Sharma
  • 1,357
  • 1
  • 21
  • 31
Sagar_Koli
  • 35
  • 6

1 Answers1

0

I think you need to add

 android {  
   defaultConfig {  
     vectorDrawables.useSupportLibrary = true  
    }  
 } 

in your build.gradle(Module:app).

For more details, Android Support Library 23.2

Edit: Make one change as below:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.1"

    defaultConfig {
        applicationId "com.noesis.bhurmalaidanmal"
        minSdkVersion 9
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        vectorDrawables.useSupportLibrary = true  
    }
    buildTypes {
        ...
    }
}

dependencies {
    ...
}
Chintan Soni
  • 24,761
  • 25
  • 106
  • 174
  • Thanks for the answer @Chintan Soni :) – Sagar_Koli Sep 26 '16 at 05:08
  • but this thing didn't worked.. Later i got to know that on using AppCompactActivity,the app was crashing. But while using Activity it is not. I am not knowing the reason why such it is happening. Due to using Activity i am unable to use Toolbar features and all new features. If you any idea about it then please let me know. Thanks alot :) – Sagar_Koli Sep 26 '16 at 05:11
  • the app crash probably because of them isn't Theme.AppCompat.Light – amorenew Sep 26 '16 at 05:49
  • http://stackoverflow.com/questions/21814825/you-need-to-use-a-theme-appcompat-theme-or-descendant-with-this-activity – amorenew Sep 26 '16 at 05:50
  • FATAL EXCEPTION: main Process: com.noesis.bhurmalaidanmal, PID: 4438 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.noesis.bhurmalaidanmal/com.noesis.bhurmalaidanmal.MainActivity}: java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2198) – Sagar_Koli Sep 26 '16 at 07:27
  • It is not working... Even i tried to change theme to Theme.AppCompat.Light ..still having the same problem. – Sagar_Koli Sep 26 '16 at 07:28
  • 1
    Found the solution. My ClassPath gradle was 2.8 due to which it was not supporting the tools. So i edited it in gradle.properties to 2.10. And surprisingly it worked – Sagar_Koli Sep 26 '16 at 10:03