Crash using Animated Vector Drawable - Device running 7.1.1 - android

I get the following crash when using animated vector drawable - my setup is
Devices tested on Nougat 7.1.1 - Oneplus 3 , Oneplus one , Nexus 6 (api 25) emulator
My code was working fine earlier , now it seems to be broken , I'm Unable to start my Activity.
// Sdk and tools
minSdkVersion = 21
targetSdkVersion = 25
compileSdkVersion = 25
buildToolsVersion = '25.0.1'
// Java
targetJVM = 1.8
// App dependencies
supportLibraryVersion = '25.1.1'
Process: techgravy.nextstop, PID: 30215
java.lang.RuntimeException: Unable to start activity ComponentInfo{techgravy.nextstop/techgravy.nextstop.ui.search.SearchActivity}: android.view.InflateException: Could not instantiate class android.transition.Transition class techgravy.nextstop.ui.transitions.StartAnimatable
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2728)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2814)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6290)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: android.view.InflateException: Could not instantiate class android.transition.Transition class techgravy.nextstop.ui.transitions.StartAnimatable
at android.transition.TransitionInflater.createCustom(TransitionInflater.java:227)
at android.transition.TransitionInflater.createTransitionFromXml(TransitionInflater.java:171)
at android.transition.TransitionInflater.createTransitionFromXml(TransitionInflater.java:185)
at android.transition.TransitionInflater.inflateTransition(TransitionInflater.java:79)
at com.android.internal.policy.PhoneWindow.getTransition(PhoneWindow.java:2799)
at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:2762)
at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:413)
at android.app.Activity.setContentView(Activity.java:2444)
at techgravy.nextstop.ui.search.SearchActivity.onCreate(SearchActivity.java:120)
at android.app.Activity.performCreate(Activity.java:6760)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1134)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2681)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2814) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6290) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
at android.transition.TransitionInflater.createCustom(TransitionInflater.java:218)
at android.transition.TransitionInflater.createTransitionFromXml(TransitionInflater.java:171) 
at android.transition.TransitionInflater.createTransitionFromXml(TransitionInflater.java:185) 
at android.transition.TransitionInflater.inflateTransition(TransitionInflater.java:79) 
at com.android.internal.policy.PhoneWindow.getTransition(PhoneWindow.java:2799) 
at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:2762) 
at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:413) 
at android.app.Activity.setContentView(Activity.java:2444) 
at techgravy.nextstop.ui.search.SearchActivity.onCreate(SearchActivity.java:120) 
at android.app.Activity.performCreate(Activity.java:6760) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1134) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2681) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2814) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6290) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 
Caused by: android.content.res.Resources$NotFoundException: Drawable techgravy.nextstop:drawable/avd_back_to_search with resource ID #0x7f02005b
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/avd_back_to_search.xml from drawable resource ID #0x7f02005b
at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:725)
at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:571)
at android.content.res.Resources.loadDrawable(Resources.java:858)
at android.content.res.TypedArray.getDrawable(TypedArray.java:928)
at techgravy.nextstop.ui.transitions.StartAnimatable.<init>(StartAnimatable.java:54)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
at android.transition.TransitionInflater.createCustom(TransitionInflater.java:218)
at android.transition.TransitionInflater.createTransitionFromXml(TransitionInflater.java:171)
at android.transition.TransitionInflater.createTransitionFromXml(TransitionInflater.java:185)
at android.transition.TransitionInflater.inflateTransition(TransitionInflater.java:79)
at com.android.internal.policy.PhoneWindow.getTransition(PhoneWindow.java:2799)
at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:2762)
at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:413)
at android.app.Activity.setContentView(Activity.java:2444)
at techgravy.nextstop.ui.search.SearchActivity.onCreate(SearchActivity.java:120)
at android.app.Activity.performCreate(Activity.java:6760)
03-18 21:08:32.840 30215-30215/techgravy.nextstop E/AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1134)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2681)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2814)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6290)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.ClassCastException: android.graphics.drawable.BitmapDrawable cannot be cast to android.graphics.drawable.VectorDrawable
at android.graphics.drawable.AnimatedVectorDrawable.inflate(AnimatedVectorDrawable.java:471)
at android.graphics.drawable.DrawableInflater.inflateFromXml(DrawableInflater.java:130)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1227)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:1200)
at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:715)
... 27 more
res/drawable/avd_back_to_search.xml
<animated-vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="#drawable/searchback_back">
<target
android:name="arrow_head"
android:animation="#animator/searchback_hide_arrow_head_move" />
<target
android:name="arrow_head_top"
android:animation="#animator/searchback_hide_arrow_head" />
<target
android:name="arrow_head_bottom"
android:animation="#animator/searchback_hide_arrow_head" />
<target
android:name="stem"
android:animation="#animator/searchback_stem_back_to_search" />
<target
android:name="search_circle"
android:animation="#animator/searchback_show_circle" />
</animated-vector>

Related

ClassNotFoundException when starting any new activity

When I try to start any activity beside MainActivity in application, I experience a crash in some devices.
as I can see in crashAnalytics it does not depend on the version or brand of the device or android version,
fatal exception don't refers to any line in my project.
already tried to delete .gradle folder / clear project, does not work.
03-30 19:13:46.458 7597-7597/ru.sberleasing E/AndroidRuntime: FATAL EXCEPTION: main
Process: ru.sberleasing, PID: 7597
java.lang.NoClassDefFoundError: java.lang.invoke.SerializedLambda
at libcore.reflect.InternalNames.getClass(InternalNames.java:55)
at java.lang.Class.getDexCacheType(Class.java:476)
at java.lang.reflect.AbstractMethod.getParameterTypes(AbstractMethod.java:166)
at java.lang.reflect.Method.getParameterTypes(Method.java:170)
at java.lang.Class.getDeclaredMethods(Class.java:673)
at java.io.ObjectStreamClass.computeSerialVersionUID(ObjectStreamClass.java:566)
at java.io.ObjectStreamClass.createClassDesc(ObjectStreamClass.java:279)
at java.io.ObjectStreamClass.lookupStreamClass(ObjectStreamClass.java:1087)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:1055)
at java.io.ObjectStreamClass.createClassDesc(ObjectStreamClass.java:268)
at java.io.ObjectStreamClass.lookupStreamClass(ObjectStreamClass.java:1087)
at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1554)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461)
at android.os.Parcel.writeSerializable(Parcel.java:1442)
at android.os.Parcel.writeValue(Parcel.java:1395)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:665)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1330)
at android.os.Bundle.writeToParcel(Bundle.java:1079)
at android.os.Parcel.writeBundle(Parcel.java:690)
at androidx.fragment.app.FragmentState.writeToParcel(FragmentState.java:167)
at android.os.Parcel.writeTypedList(Parcel.java:1148)
at androidx.fragment.app.FragmentManagerState.writeToParcel(FragmentManagerState.java:51)
at android.os.Parcel.writeParcelable(Parcel.java:1416)
at android.os.Parcel.writeValue(Parcel.java:1322)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:665)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1330)
at android.os.Bundle.writeToParcel(Bundle.java:1079)
at android.os.Parcel.writeBundle(Parcel.java:690)
at android.app.ActivityManagerProxy.activityStopped(ActivityManagerNative.java:3152)
at android.app.ActivityThread$StopInfo.run(ActivityThread.java:3417)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.lang.invoke.SerializedLambda" on path: DexPathList[[zip file "/data/app/ru.sberleasing-2/base.apk"],nativeLibraryDirectories=[/data/app/ru.sberleasing-2/lib/x86, /data/app/ru.sberleasing-2/base.apk!/lib/x86, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at libcore.reflect.InternalNames.getClass(InternalNames.java:53)
at java.lang.Class.getDexCacheType(Class.java:476) 
at java.lang.reflect.AbstractMethod.getParameterTypes(AbstractMethod.java:166) 
at java.lang.reflect.Method.getParameterTypes(Method.java:170) 
at java.lang.Class.getDeclaredMethods(Class.java:673) 
at java.io.ObjectStreamClass.computeSerialVersionUID(ObjectStreamClass.java:566) 
at java.io.ObjectStreamClass.createClassDesc(ObjectStreamClass.java:279) 
at java.io.ObjectStreamClass.lookupStreamClass(ObjectStreamClass.java:1087) 
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:1055) 
at java.io.ObjectStreamClass.createClassDesc(ObjectStreamClass.java:268) 
at java.io.ObjectStreamClass.lookupStreamClass(ObjectStreamClass.java:1087) 
at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1554) 
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497) 
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461) 
at android.os.Parcel.writeSerializable(Parcel.java:1442) 
at android.os.Parcel.writeValue(Parcel.java:1395) 
at android.os.Parcel.writeArrayMapInternal(Parcel.java:665) 
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1330) 
at android.os.Bundle.writeToParcel(Bundle.java:1079) 
at android.os.Parcel.writeBundle(Parcel.java:690) 
at androidx.fragment.app.FragmentState.writeToParcel(FragmentState.java:167) 
at android.os.Parcel.writeTypedList(Parcel.java:1148) 
at androidx.fragment.app.FragmentManagerState.writeToParcel(FragmentManagerState.java:51) 
at android.os.Parcel.writeParcelable(Parcel.java:1416) 
at android.os.Parcel.writeValue(Parcel.java:1322) 
at android.os.Parcel.writeArrayMapInternal(Parcel.java:665) 
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1330) 
at android.os.Bundle.writeToParcel(Bundle.java:1079) 
at android.os.Parcel.writeBundle(Parcel.java:690) 
at android.app.ActivityManagerProxy.activityStopped(ActivityManagerNative.java:3152) 
at android.app.ActivityThread$StopInfo.run(ActivityThread.java:3417) 
at android.os.Handler.handleCallback(Handler.java:739) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5417) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
Suppressed: java.lang.ClassNotFoundException: java.lang.invoke.SerializedLambda
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 39 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
in my case problem was in Compile version.
probably voximplant-sdk conflicts with api 29, version downgrading solved the problem for now.

"Error inflating class com.androidplot.xy.XYPlot" when I try to inflate my graph Fragment

When I debug my android app and I try to open my graph fragment, my app crashes. I put the "androidplot-core-1.5.7.aar" library in my "libs" project folder and implement it in my "build.gradle" dependencies.
I don't have this issue with the "androidplot-core-1.2.1.aar" library.
here is the graph fragment xml code :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ap="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.androidplot.xy.XYPlot
android:id="#+id/imuPlot"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
style="#style/APDefacto.Light"/>
</LinearLayout>
Here is what it shows when I want to show a graph fragment and debug crashes :
--------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.poc2.irisa.plugandpos.poc2, PID: 5048
android.view.InflateException: Binary XML file line #8: Binary XML file line #8: Error inflating class com.androidplot.xy.XYPlot
Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class com.androidplot.xy.XYPlot
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
at android.view.LayoutInflater.createView(LayoutInflater.java:645)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:858)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
at com.poc2.irisa.plugandpos.poc2.o.a(:52)
at android.support.v4.app.m.b(:2346)
at android.support.v4.app.z.a(:1428)
at android.support.v4.app.z.h(:1759)
at android.support.v4.app.z.a(:1827)
at android.support.v4.app.d.c(:797)
at android.support.v4.app.z.a(:2596)
at android.support.v4.app.z.b(:2383)
at android.support.v4.app.z.c(:2338)
at android.support.v4.app.z.p(:2245)
at android.support.v4.app.t.run(:703)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6120)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/halfhp/fig/Fig;
at com.androidplot.Plot.a(:561)
at com.androidplot.Plot.a(:403)
at com.androidplot.Plot.<init>(:324)
at com.androidplot.xy.XYPlot.<init>(:143)
at java.lang.reflect.Constructor.newInstance0(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:430) 
at android.view.LayoutInflater.createView(LayoutInflater.java:645) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:858) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:518) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:426) 
at com.poc2.irisa.plugandpos.poc2.o.a(:52) 
at android.support.v4.app.m.b(:2346) 
at android.support.v4.app.z.a(:1428) 
at android.support.v4.app.z.h(:1759) 
at android.support.v4.app.z.a(:1827) 
at android.support.v4.app.d.c(:797) 
at android.support.v4.app.z.a(:2596) 
at android.support.v4.app.z.b(:2383) 
at android.support.v4.app.z.c(:2338) 
at android.support.v4.app.z.p(:2245) 
at android.support.v4.app.t.run(:703) 
at android.os.Handler.handleCallback(Handler.java:751) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6120) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) 
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.halfhp.fig.Fig" on path: DexPathList[[zip file "/data/app/com.poc2.irisa.plugandpos.poc2-1/base.apk"],nativeLibraryDirectories=[/data/app/com.poc2.irisa.plugandpos.poc2-1/lib/arm, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.androidplot.Plot.a(:561) 
at com.androidplot.Plot.a(:403) 
at com.androidplot.Plot.<init>(:324) 
at com.androidplot.xy.XYPlot.<init>(:143) 
at java.lang.reflect.Constructor.newInstance0(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:430) 
at android.view.LayoutInflater.createView(LayoutInflater.java:645) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:858) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:518) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:426) 
at com.poc2.irisa.plugandpos.poc2.o.a(:52) 
at android.support.v4.app.m.b(:2346) 
at android.support.v4.app.z.a(:1428) 
at android.support.v4.app.z.h(:1759) 
at android.support.v4.app.z.a(:1827) 
at android.support.v4.app.d.c(:797) 
at android.support.v4.app.z.a(:2596) 
at android.support.v4.app.z.b(:2383) 
at android.support.v4.app.z.c(:2338) 
at android.support.v4.app.z.p(:2245) 
at android.support.v4.app.t.run(:703) 
at android.os.Handler.handleCallback(Handler.java:751) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6120) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) 
Disconnected from the target VM, address: 'localhost:8600', transport: 'socket'
Thanks in advance.
Best regards,
Malo
Just answering for myself after finding the question having had the same issue.
I had to add the following to my "build.gradle" dependencies.
implementation "com.halfhp.fig:figlib:1.0.7"

NoClassFoundError: java.util.stream.Stream

I am writing an Android app using Kotlin.
I am receiving NoClassFoundError for java.util.stream.Stream.
At no point in my app am I using that class.
It happens when I open an ad and appears to be part of the serialization process.
It does not happen on all my devices. Only on my older one (5.1.1).
It also does not happen on all the activities.
I'm guessing that it is to do with what it is trying to Serialize. However, I am not sure where to even start.
java.lang.NoClassDefFoundError: java.util.stream.Stream
at libcore.reflect.InternalNames.getClass(InternalNames.java:55)
at java.lang.Class.getDexCacheType(Class.java:479)
at java.lang.reflect.ArtMethod.getDexCacheType(ArtMethod.java:191)
at java.lang.reflect.ArtMethod.getReturnType(ArtMethod.java:145)
at java.lang.reflect.Method.getReturnType(Method.java:184)
at java.lang.Class.getDeclaredMethods(Class.java:771)
at java.io.ObjectStreamClass.computeSerialVersionUID(ObjectStreamClass.java:566)
at java.io.ObjectStreamClass.createClassDesc(ObjectStreamClass.java:279)
at java.io.ObjectStreamClass.lookupStreamClass(ObjectStreamClass.java:1087)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:1055)
at java.io.ObjectStreamClass.createClassDesc(ObjectStreamClass.java:268)
at java.io.ObjectStreamClass.lookupStreamClass(ObjectStreamClass.java:1087)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:1055)
at java.io.ObjectStreamClass.createClassDesc(ObjectStreamClass.java:268)
at java.io.ObjectStreamClass.lookupStreamClass(ObjectStreamClass.java:1087)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:1055)
at java.io.ObjectStreamClass.createClassDesc(ObjectStreamClass.java:268)
at java.io.ObjectStreamClass.lookupStreamClass(ObjectStreamClass.java:1087)
at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1554)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461)
at java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:959)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:360)
at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1054)
at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1384)
at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1651)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461)
at android.os.Parcel.writeSerializable(Parcel.java:1389)
at android.os.Parcel.writeValue(Parcel.java:1341)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:644)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1313)
at android.os.Bundle.writeToParcel(Bundle.java:1034)
at android.os.Parcel.writeBundle(Parcel.java:669)
at android.app.ActivityManagerProxy.activityStopped(ActivityManagerNative.java:2919)
at android.app.ActivityThread$StopInfo.run(ActivityThread.java:3296)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.util.stream.Stream" on path: DexPathList[[zip file "/data/app/il.co.anykey.games.cardflip-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at libcore.reflect.InternalNames.getClass(InternalNames.java:53)
at java.lang.Class.getDexCacheType(Class.java:479) 
at java.lang.reflect.ArtMethod.getDexCacheType(ArtMethod.java:191) 
at java.lang.reflect.ArtMethod.getReturnType(ArtMethod.java:145) 
at java.lang.reflect.Method.getReturnType(Method.java:184) 
at java.lang.Class.getDeclaredMethods(Class.java:771) 
at java.io.ObjectStreamClass.computeSerialVersionUID(ObjectStreamClass.java:566) 
at java.io.ObjectStreamClass.createClassDesc(ObjectStreamClass.java:279) 
at java.io.ObjectStreamClass.lookupStreamClass(ObjectStreamClass.java:1087) 
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:1055) 
at java.io.ObjectStreamClass.createClassDesc(ObjectStreamClass.java:268) 
at java.io.ObjectStreamClass.lookupStreamClass(ObjectStreamClass.java:1087) 
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:1055) 
at java.io.ObjectStreamClass.createClassDesc(ObjectStreamClass.java:268) 
at java.io.ObjectStreamClass.lookupStreamClass(ObjectStreamClass.java:1087) 
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:1055) 
at java.io.ObjectStreamClass.createClassDesc(ObjectStreamClass.java:268) 
at java.io.ObjectStreamClass.lookupStreamClass(ObjectStreamClass.java:1087) 
at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1554) 
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497) 
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461) 
at java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:959) 
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:360) 
at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1054) 
at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1384) 
at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1651) 
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497) 
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461) 
at android.os.Parcel.writeSerializable(Parcel.java:1389) 
at android.os.Parcel.writeValue(Parcel.java:1341) 
at android.os.Parcel.writeArrayMapInternal(Parcel.java:644) 
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1313) 
at android.os.Bundle.writeToParcel(Bundle.java:1034) 
at android.os.Parcel.writeBundle(Parcel.java:669) 
at android.app.ActivityManagerProxy.activityStopped(ActivityManagerNative.java:2919) 
at android.app.ActivityThread$StopInfo.run(ActivityThread.java:3296) 
at android.os.Handler.handleCallback(Handler.java:739) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:135) 
at android.app.ActivityThread.main(ActivityThread.java:5254) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 
Suppressed: java.lang.ClassNotFoundException: java.util.stream.Stream
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 45 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
As documentation says java.util.stream require API level 24 or higher. Android 5.1.1 is API 22, it doesn't have java.util.stream.Stream class.

Can't convert value at index 1 to color: type=0x5

As soon as I put the tags app:shadowColor="#android:color/black" and the rest of the codes, my app crashes.
<info.hoang8f.widget.FButton
android:id="#+id/btnSignUp"
android:layout_width="14dp"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_weight="1"
android:text="Sign Up"
android:textColor="#android:color/white"
app:buttonColor="#color/btnSignUp"
app:shadowColor="#android:color/black"
app:shadowEnabled="true"
app:shadowHeight="5dp"
app:cornerRadius="4dp"
/>
Here Is the logcat
02-10 21:00:20.793 15027-15027/edmt.dev.androideatit E/AndroidRuntime: FATAL EXCEPTION: main
Process: edmt.dev.androideatit, PID: 15027
java.lang.RuntimeException: Unable to start activity ComponentInfo{edmt.dev.androideatit/edmt.dev.androideatit.MainActivity}: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class info.hoang8f.widget.FButton
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
Caused by: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class info.hoang8f.widget.FButton
Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class info.hoang8f.widget.FButton
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
at android.view.LayoutInflater.createView(LayoutInflater.java:645)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:858)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:861)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
at android.view.LayoutInflater.inflate(LayoutInflater.java:377)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at edmt.dev.androideatit.MainActivity.onCreate(MainActivity.java:17)
at android.app.Activity.performCreate(Activity.java:6662)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
Caused by: java.lang.UnsupportedOperationException: Can't convert value at index 1 to color: type=0x5
at android.content.res.TypedArray.getColor(TypedArray.java:463)
at info.hoang8f.widget.FButton.parseAttrs(FButton.java:116)
at info.hoang8f.widget.FButton.(FButton.java:52)
at java.lang.reflect.Constructor.newInstance0(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:430) 
at android.view.LayoutInflater.createView(LayoutInflater.java:645) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:858) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:861) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:518) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:426) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:377) 
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287) 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139) 
at edmt.dev.androideatit.MainActivity.onCreate(MainActivity.java:17) 
at android.app.Activity.performCreate(Activity.java:6662) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6077) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756) 
You didn't close the shadowHeight tag. You should close like app:shadowHeight="5dp"
I've solved the same problem by replacing minSdkVersion 23 in build.gradle & also you need to cast it by using following line of code in java file.
Button b = (Button)findViewById(R.id.btnId);
Hope it will help in future.

ClassNotFoundException exception after updating the minSdkversion to 21

Started getting this error after updating the value of minSdkVersion to 21 from 19. It occurs only on 5.0 devices, devices with OS 6+ works fine
Application has all the multidex properties included. Also as suggested by google that multidex is not require if minSdkVersion is 21 but that too does throws the similar error.
Tried cleaning the project, cache etc
Tried disabling the instant run but no luck so far.
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/agent/android/instrumentation/GsonInstrumentation;
at com.demo.app.persistence.Datastore.getMember(Datastore.java:142)
at com.demo.app.Application.initDatastore(Application.java:139)
at com.demo.app.Application.onCreate(Application.java:84)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1020)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5010)
at android.app.ActivityThread.access$1600(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1482)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5835)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.newrelic.agent.android.instrumentation.GsonInstrumentation" on path: DexPathList[[zip file "/data/app/com.demo.apptracker-1/base.apk"],nativeLibraryDirectories=[/data/app/com.babycenter.pregnancytracker-1/lib/arm, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.demo.app.persistence.Datastore.getMember(Datastore.java:142) 
at com.demo.app.Application.initDatastore(Application.java:139) 
at com.demo.app.Application.onCreate(Application.java:84) 
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1020) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5010) 
at android.app.ActivityThread.access$1600(ActivityThread.java:172) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1482) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:145) 
at android.app.ActivityThread.main(ActivityThread.java:5835) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194) 
Suppressed: java.lang.ClassNotFoundException: com.newrelic.agent.android.instrumentation.GsonInstrumentation
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 15 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

Categories

Resources