Android Question App stops working android 4.4 AppCompat

rscheel

Well-Known Member
Licensed User
Longtime User
As the title says my application lets not start stops working when you open it, this only happens in android from android 4.4 down, android 5 up works correctly, I can realize that the following line of code causes the problem.

B4X:
#Extends: android.support.v7.app.AppCompatActivity

thanks.
 

rscheel

Well-Known Member
Licensed User
Longtime User
I'm using the latest version of appcompat and the latest version of B4A, I can not send the log as the application falls to run and shows nothing in the log.

If you want you can send the code of the application by private message.
 
Upvote 0

rscheel

Well-Known Member
Licensed User
Longtime User
Can you post the unfiltered logs? Make sure to connect in USB debug mode.

Dear this is what shows the log

B4X:
LogCat connected to: 64b497ca
--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
 
Upvote 0

rscheel

Well-Known Member
Licensed User
Longtime User
It leaves a lot of text but nothing marked in red, and nothing appears identifying the problem, the extent of the log I can not publish.
 
Upvote 0

rscheel

Well-Known Member
Licensed User
Longtime User
I have reviewed and I found this referred to appcompat

B4X:
VFY: unable to resolve virtual method 550: Landroid/content/res/TypedArray;.getType (I)I
VFY: replacing opcode 0x6e at 0x0008
Exception while inflating <vector>
org.xmlpull.v1.XmlPullParserException: Binary XML file line #17<vector> tag requires viewportWidth > 0
    at android.support.graphics.drawable.VectorDrawableCompat.updateStateFromTypedArray(VectorDrawableCompat.java:541)
    at android.support.graphics.drawable.VectorDrawableCompat.inflate(VectorDrawableCompat.java:478)
    at android.support.graphics.drawable.VectorDrawableCompat.createFromXmlInner(VectorDrawableCompat.java:441)
    at android.support.v7.widget.AppCompatDrawableManager$VdcInflateDelegate.createFromXmlInner(AppCompatDrawableManager.java:742)
    at android.support.v7.widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:362)
    at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:192)
    at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:185)
    at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:720)
    at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:190)
    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 de.amberhome.appcompat.basicexample.main.onCreate(main.java:33)
    at android.app.Activity.performCreate(Activity.java:5582)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2405)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2500)
    at android.app.ActivityThread.access$900(ActivityThread.java:171)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1309)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:146)
    at android.app.ActivityThread.main(ActivityThread.java:5679)
    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:1291)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
    at dalvik.system.NativeStart.main(Native Method)
Shutting down VM
threadid=1: thread exiting with uncaught exception (group=0x41835da0)
FATAL EXCEPTION: main
Process: de.amberhome.appcompat.basicexample, PID: 30183
java.lang.RuntimeException: Unable to start activity ComponentInfo{de.amberhome.appcompat.basicexample/de.amberhome.appcompat.basicexample.main}: android.content.res.Resources$NotFoundException: File res/drawable/abc_vector_test.xml from drawable resource ID #0x7f020052

    at dalvik.system.NativeStart.main(Native Method)
Shutting down VM
threadid=1: thread exiting with uncaught exception (group=0x41835da0)
FATAL EXCEPTION: main
Process: de.amberhome.appcompat.basicexample, PID: 30183
java.lang.RuntimeException: Unable to start activity ComponentInfo{de.amberhome.appcompat.basicexample/de.amberhome.appcompat.basicexample.main}: android.content.res.Resources$NotFoundException: File res/drawable/abc_vector_test.xml from drawable resource ID #0x7f020052
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2441)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2500)
    at android.app.ActivityThread.access$900(ActivityThread.java:171)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1309)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:146)
    at android.app.ActivityThread.main(ActivityThread.java:5679)
    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:1291)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/abc_vector_test.xml from drawable resource ID #0x7f020052
    at android.content.res.Resources.loadDrawable(Resources.java:3439)
    at android.content.res.Resources.getDrawable(Resources.java:1893)
    at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:346)
    at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:197)
    at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:185)
    at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:720)
    at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:190)
    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 de.amberhome.appcompat.basicexample.main.onCreate(main.java:33)
    at android.app.Activity.performCreate(Activity.java:5582)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2405)
    ... 11 more
Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #17: invalid drawable tag vector
    at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:986)
 
Upvote 0

rscheel

Well-Known Member
Licensed User
Longtime User
Are you using B4A v6+ ?

Try to update the Android SDK build tools and support repository.

I'm using the latest version of B4A 6.30 but with the v6 same happens the same, I'm using the latest version of sdk and repositories, even update the jdk, and the same thing happens, not if someone else will have this same problem or I'll be just me.

And I'm using the version v3.30 AppCompat.
 
Upvote 0

corwin42

Expert
Licensed User
Longtime User
I have reviewed and I found this referred to appcompat

B4X:
VFY: unable to resolve virtual method 550: Landroid/content/res/TypedArray;.getType (I)I
VFY: replacing opcode 0x6e at 0x0008
Exception while inflating <vector>
org.xmlpull.v1.XmlPullParserException: Binary XML file line #17<vector> tag requires viewportWidth > 0
    at android.support.graphics.drawable.VectorDrawableCompat.updateStateFromTypedArray(VectorDrawableCompat.java:541)
    at android.support.graphics.drawable.VectorDrawableCompat.inflate(VectorDrawableCompat.java:478)

Read the AppCompat library setup instructions and be sure you follow step 3. Don't miss the part in bold and red. (Guess why it is bold and red)

@Erel You said that in latest B4A versions 23.0.3 Build tools will be preferred. This seems not to be completely true since this error was reported many times in the past. Every time the solution was to deinstall all Build tools except 23.0.3. It seems that an older aapt version is used when it is installed.
 
Upvote 0

rscheel

Well-Known Member
Licensed User
Longtime User
Read the AppCompat library setup instructions and be sure you follow step 3. Don't miss the part in bold and red. (Guess why it is bold and red)

@Erel You said that in latest B4A versions 23.0.3 Build tools will be preferred. This seems not to be completely true since this error was reported many times in the past. Every time the solution was to deinstall all Build tools except 23.0.3. It seems that an older aapt version is used when it is installed.

Dear thank you very much for your reply, that part had not read, as I have long using AppCompat and had never had problems with this, sometimes you omit some instructions are simple but cause a big problem, thanks for everything and regreted caused.
 
Upvote 0

corwin42

Expert
Licensed User
Longtime User
Dear thank you very much for your reply, that part had not read, as I have long using AppCompat and had never had problems with this, sometimes you omit some instructions are simple but cause a big problem, thanks for everything and regreted caused.

For AppCompat it is important to read the setup instructions for every release. Google sometimes changes important things in the support libraries (like in this case they introduced vector drawables which need special Build Tools version to get them work on Android <5.0) and I try to keep the installation instructions up to date as good as possible.

Unfortunately I can't read all questions in the questions forum anymore so I sometimes miss AppCompat related questions.
 
Upvote 0
Top