Issue
This error comes only when I run my application on an Android 4.4.2, not when I run it on Android 5 or above.
XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">
<TextView android:text="Hello World!" android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gmail.saadbnwhd.mybudget" >
<application
android:allowBackup="true"
android:icon="@drawable/budget"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
android:largeHeap="true"
<activity android:name=".MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<provider
android:name=".data.NoteContentProvider"
android:authorities="com.okason.simplenotesapp.data.provider"
android:exported="false"
android:multiprocess="true" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Addition" >
</activity>
</application>
</manifest>
App.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.gmail.saadbnwhd.mybudget"
minSdkVersion 19
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:23.2.0'
compile "com.android.support:support-core-utils:24.2.0"
compile 'com.android.support:support-v4:24.2.0'
compile 'com.android.support:design:24.2.0'
compile 'com.android.support:appcompat-v7:24.2.0'
// compile 'com.mobilesiri.sqliteexample'
}
LogCat:
09-20 11:52:12.576 24023-24023/? E/cutils-trace: Error opening trace file: No such file or directory (2)
09-20 11:52:12.756 24023-24023/? E/memtrack: Couldn't load memtrack module (No such file or directory)
09-20 11:52:12.756 24023-24023/? E/android.os.Debug: failed to load memtrack module: -2
09-20 11:52:12.848 24023-24033/? E/jdwp: jdwp::setsockopt(SO_SNDTIMEO)
09-20 11:52:12.848 24023-24033/? E/jdwp: jdwp::setsockopt(SO_RCVTIMEO)
09-20 11:52:13.373 24038-24038/? E/cutils-trace: Error opening trace file: No such file or directory (2)
09-20 11:52:13.540 24038-24038/? E/memtrack: Couldn't load memtrack module (No such file or directory)
09-20 11:52:13.540 24038-24038/? E/android.os.Debug: failed to load memtrack module: -2
09-20 11:52:13.637 24038-24044/? E/jdwp: jdwp::setsockopt(SO_SNDTIMEO)
09-20 11:52:13.637 24038-24044/? E/jdwp: jdwp::setsockopt(SO_RCVTIMEO)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: Exception while inflating <vector>
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: org.xmlpull.v1.XmlPullParserException: Binary XML file line #17<vector> tag requires viewportWidth > 0
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.support.graphics.drawable.VectorDrawableCompat.updateStateFromTypedArray(VectorDrawableCompat.java:541)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.support.graphics.drawable.VectorDrawableCompat.inflate(VectorDrawableCompat.java:478)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.support.graphics.drawable.VectorDrawableCompat.createFromXmlInner(VectorDrawableCompat.java:441)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.support.v7.widget.AppCompatDrawableManager$VdcInflateDelegate.createFromXmlInner(AppCompatDrawableManager.java:736)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.support.v7.widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:359)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:189)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:182)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:717)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:187)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:77)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.support.v7.app.AppCompatDelegateImplBase.<init>(AppCompatDelegateImplBase.java:127)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.support.v7.app.AppCompatDelegateImplV9.<init>(AppCompatDelegateImplV9.java:147)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:27)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:50)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:201)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:181)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:521)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at com.gmail.saadbnwhd.mybudget.MainActivity.onCreate(MainActivity.java:16)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.app.Activity.performCreate(Activity.java:5343)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2343)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2441)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.app.ActivityThread.access$900(ActivityThread.java:151)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.os.Handler.dispatchMessage(Handler.java:110)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.os.Looper.loop(Looper.java:193)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at android.app.ActivityThread.main(ActivityThread.java:5345)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at java.lang.reflect.Method.invokeNative(Native Method)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at java.lang.reflect.Method.invoke(Method.java:515)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
09-20 11:52:13.751 24048-24048/? E/VdcInflateDelegate: at dalvik.system.NativeStart.main(Native Method)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: FATAL EXCEPTION: main
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: Process: com.gmail.saadbnwhd.mybudget, PID: 24048
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gmail.saadbnwhd.mybudget/com.gmail.saadbnwhd.mybudget.MainActivity}: android.content.res.Resources$NotFoundException: File res/drawable/abc_vector_test.xml from drawable resource ID #0x7f02004f
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2389)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2441)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.app.ActivityThread.access$900(ActivityThread.java:151)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:110)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.os.Looper.loop(Looper.java:193)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5345)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:515)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: Caused by: android.content.res.Resources$NotFoundException: File res/drawable/abc_vector_test.xml from drawable resource ID #0x7f02004f
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.content.res.Resources.loadDrawable(Resources.java:2152)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.content.res.Resources.getDrawable(Resources.java:710)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:346)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:194)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:182)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:717)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:187)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:77)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.app.AppCompatDelegateImplBase.<init>(AppCompatDelegateImplBase.java:127)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.app.AppCompatDelegateImplV9.<init>(AppCompatDelegateImplV9.java:147)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:27)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:50)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:201)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:181)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:521)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at com.gmail.saadbnwhd.mybudget.MainActivity.onCreate(MainActivity.java:16)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.app.Activity.performCreate(Activity.java:5343)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2343)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2441)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.app.ActivityThread.access$900(ActivityThread.java:151)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:110)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.os.Looper.loop(Looper.java:193)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5345)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:515)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #17: invalid drawable tag vector
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:933)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.graphics.drawable.Drawable.createFromXml(Drawable.java:877)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.content.res.Resources.loadDrawable(Resources.java:2148)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.content.res.Resources.getDrawable(Resources.java:710)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:346)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:194)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:182)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:717)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:187)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:77)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.app.AppCompatDelegateImplBase.<init>(AppCompatDelegateImplBase.java:127)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.app.AppCompatDelegateImplV9.<init>(AppCompatDelegateImplV9.java:147)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:27)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:50)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:201)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:181)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:521)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at com.gmail.saadbnwhd.mybudget.MainActivity.onCreate(MainActivity.java:16)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.app.Activity.performCreate(Activity.java:5343)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2343)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2441)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.app.ActivityThread.access$900(ActivityThread.java:151)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:110)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.os.Looper.loop(Looper.java:193)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5345)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:515)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
09-20 11:52:13.763 24048-24048/? E/AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)
Solution
It's solved. I had to upgrade my gradle plugin version using:
classpath 'com.android.tools.build:gradle:1.5.0'
The problem was with the AssetTag thingy which was causing invalid drawable tag vector
.
Had to add two lines in gradle for that.
This is what the app.gradle's edited portion looked like then.
defaultConfig {
applicationId "com.gmail.saadbnwhd.sfas"
minSdkVersion 19
targetSdkVersion 24
versionCode 1
versionName "1.0"
generatedDensities = [] //Added line 1st
}
//Added lines 2nd
aaptOptions {
additionalParameters "--no-version-vectors"
}
Plus, I had to update my Android SDK, and get its 'Android Support Library' from SDK Manager.
Answered By - izSaad
Answer Checked By - Dawn Plyler (JavaFixing Volunteer)