SpeedView: Crash on android 4.0.4 (android.view.InflateException)
I have runtime exception on android 4.0.4 (Sony ericsson xperia neo v (MT11I)). Reproduced in sample project with one simple activity.
Layout:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.tridetch.speedviewexample.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<com.github.anastr.speedviewlib.SpeedView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</android.support.constraint.ConstraintLayout>
Stack trace
08-24 13:10:18.527 11630-11630/com.example.tridetch.speedviewexample E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.tridetch.speedviewexample/com.example.tridetch.speedviewexample.MainActivity}: android.view.InflateException: Binary XML file line #19: Error inflating class com.github.anastr.speedviewlib.SpeedView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4441)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #19: Error inflating class com.github.anastr.speedviewlib.SpeedView
at android.view.LayoutInflater.createView(LayoutInflater.java:606)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:292)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.example.tridetch.speedviewexample.MainActivity.onCreate(MainActivity.java:11)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4441)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:586)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:292)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.example.tridetch.speedviewexample.MainActivity.onCreate(MainActivity.java:11)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4441)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.StackOverflowError
at com.github.anastr.speedviewlib.base.Gauge.setPaddingRelative(Gauge.java:1225)
at android.view.View.setPadding(View.java:11973)
at com.github.anastr.speedviewlib.base.Gauge.updatePadding(Gauge.java:295)
at com.github.anastr.speedviewlib.base.Gauge.setPaddingRelative(Gauge.java:1226)
at android.view.View.setPadding(View.java:11973)
at com.github.anastr.speedviewlib.base.Gauge.updatePadding(Gauge.java:295)
at com.github.anastr.speedviewlib.base.Gauge.setPaddingRelative(Gauge.java:1226)
at android.view.View.setPadding(View.java:11973)
at com.github.anastr.speedviewlib.base.Gauge.updatePadding(Gauge.java:295)
at com.github.anastr.speedviewlib.base.Gauge.setPaddingRelative(Gauge.java:1226)
at android.view.View.setPadding(View.java:11973)
at com.github.anastr.speedviewlib.base.Gauge.updatePadding(Gauge.java:295)
at com.github.anastr.speedviewlib.base.Gauge.setPaddingRelative(Gauge.java:1226)
at android.view.View.setPadding(View.java:11973)
at com.github.anastr.speedviewlib.base.Gauge.updatePadding(Gauge.java:295)
at com.github.anastr.speedviewlib.base.Gauge.setPaddingRelative(Gauge.java:1226)
at android.view.View.setPadding(View.java:11973)
at com.github.anastr.speedviewlib.base.Gauge.updatePadding(Gauge.java:295)
at com.github.anastr.speedviewlib.base.Gauge.setPaddingRelative(Gauge.java:1226)
at android.view.View.setPadding(View.java:11973)
at com.github.anastr.speedviewlib.base.Gauge.updatePadding(Gauge.java:295)
at com.github.anastr.speedviewlib.base.Gauge.setPaddingRelative(Gauge.java:1226)
at android.view.View.setPadding(View.java:11973)
at com.github.anastr.speedviewlib.base.Gauge.updatePa
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 19 (10 by maintainers)
please, make sure you add Kotlin to your project @skd4551 @SaumyaSingh1 @adel786 .
kotlin version is “1.3.50”