java.lang.NoClassDefFoundError after adding dependences - android

I have an application to which I tried to import vlclib, the application is runing without problem but as soon as I add the library, the application stops working. The strange thing is that once added the library (I tried using "aar" file and also via repository I get java.lang.NoClassDefFoundError but not for the class in the library but for the classes I already have in my application.
If I remove the activity which point to the new library but I leave the library in dependencies everything works fine.
What can cause this problem?
UPDATE:
I tried again and the error is still the same:
I rolledback to the working version and i tried:
Import the library again as gradle dependence and the application is still working, then when i add some reference to the imported library (not in the main activity but on a secondary one the application does not start anymore giving me the following error :
12-21 13:17:14.674 30816-30816/com.pecana.example E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pecana.example/com.pecana.example.MainActivity}: android.view.InflateException: Binary XML file line #27: Error inflating class com.pecana.example.SlidingTabLayout
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2295)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349)
at android.app.ActivityThread.access$700(ActivityThread.java:159)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5419)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #27: Error inflating class com.pecana.example.SlidingTabLayout
at android.view.LayoutInflater.createView(LayoutInflater.java:626)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:769)
at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
at android.view.LayoutInflater.inflate(LayoutInflater.java:354)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
at com.pecana.example.MainActivity.onCreate(MainActivity.java:162)
at android.app.Activity.performCreate(Activity.java:5372)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2257)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349) 
at android.app.ActivityThread.access$700(ActivityThread.java:159) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:176) 
at android.app.ActivityThread.main(ActivityThread.java:5419) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:525) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862) 
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:600)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:761) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:769) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:498) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:398) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:354) 
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256) 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109) 
at com.pecana.example.MainActivity.onCreate(MainActivity.java:162) 
at android.app.Activity.performCreate(Activity.java:5372) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2257) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349) 
at android.app.ActivityThread.access$700(ActivityThread.java:159) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:176) 
at android.app.ActivityThread.main(ActivityThread.java:5419) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:525) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862) 
at dalvik.system.NativeStart.main(Native Method) 
Caused by: java.lang.NoClassDefFoundError: com.pecana.example.SlidingTabStrip
at com.pecana.example.SlidingTabLayout.(SlidingTabLayout.java:102)
at com.pecana.example.SlidingTabLayout.(SlidingTabLayout.java:89)
at java.lang.reflect.Constructor.constructNative(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:417) 
at android.view.LayoutInflater.createView(LayoutInflater.java:600) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:761) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:769) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:498) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:398) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:354) 
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256) 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109) 
at com.pecana.example.MainActivity.onCreate(MainActivity.java:162) 
at android.app.Activity.performCreate(Activity.java:5372) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2257) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349) 
at android.app.ActivityThread.access$700(ActivityThread.java:159) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:176) 
at android.app.ActivityThread.main(ActivityThread.java:5419) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:525) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862) 
at dalvik.system.NativeStart.main(Native Method) 
12-21 13:17:14.799 30816-30816/com.pecana.example I/Process: Sending signal. PID: 30816 SIG: 9
UPDATE 2:
By removing some dependencies the application starts again so i guess it was related to the 65000 methods limit. But how to bypass this limit?
I Mean, I have many integration to be done in my application and i will reach it soon again.
Thank you

Related

android.view.InflateException: Binary XML file line #11: Error inflating class de.ehsun.coloredtimebar.TimelineView

I'm working on a app in which user can reserve a seat. User has to choose a time range for his booking. I wanted a time range picker in which I can customize the time whereas user can only choose time from 07:00 to 19:00. I found a library called colored-time-selector https://github.com/ehsunshine/colored-time-selector this library has everything what I was looking for.
But I'm facing below error on android kitkat 4.4 it works fine on lollipop and above.
XML
<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"
android:background=""
tools:context=".booking.test">
<de.ehsun.coloredtimebar.TimelinePickerView
android:id="#+id/timelineView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:barColorAvailable="#color/available_time_default_color"
app:barColorHighlight="#color/selector_default_color"
app:barColorNotAvailable="#color/timeline_default_color"
app:barWidth="16dp"
app:fractionLineColor="#color/separatorDark"
app:fractionLineLength="8dp"
app:fractionLineWidth="1dp"
app:fractionPrimaryTextColor="#color/fraction_default_color"
app:fractionSecondaryTextColor="#color/fraction_default_color"
app:fractionTextInterval="2"
app:fractionTextSize="8sp"
app:timeRange="07:00-19:00" />
</android.support.constraint.ConstraintLayout>
Java
public class test extends AppCompatActivity {
TimelinePickerView tl;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test); //shows error over here
//diamond operator
List<String> list = new ArrayList<>();
list.add("11:00 - 19:15");
list.add("20:00 - 21:00");
tl = (TimelinePickerView) findViewById(R.id.timelineView);
tl.setAvailableTimeRange(list);
//tl.setPickerDrawable(getResources().getDrawable(R.drawable.ic_camera));
}
}
Error
04-16 07:36:18.341 31897-31897/net.cfgvd.bookingE/AndroidRuntime: FATAL EXCEPTION: main
Process: net.cfgvd.booking, PID: 31897
java.lang.RuntimeException: Unable to start activity ComponentInfo{net.cfgvd.booking/net.cfgvd.booking.test}: android.view.InflateException: Binary XML file line #11: Error inflating class de.ehsun.coloredtimebar.TimelinePickerView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2350)
at android.app.ActivityThread.access$800(ActivityThread.java:163)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1257)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5335)
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:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class de.ehsun.coloredtimebar.TimelinePickerView
at android.view.LayoutInflater.createView(LayoutInflater.java:626)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method)
at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:631)
at android.view.LayoutInflater.inflate(Native Method)
at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
at android.view.LayoutInflater.inflate(LayoutInflater.java:354)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at net.aafushh.smoky.booking.test.onCreate(test.java:20)
at android.app.Activity.performCreate(Activity.java:5389)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2256)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2350) 
at android.app.ActivityThread.access$800(ActivityThread.java:163) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1257) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:157) 
at android.app.ActivityThread.main(ActivityThread.java:5335) 
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:1265) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081) 
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132) 
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:423)
at android.view.LayoutInflater.createView(LayoutInflater.java:600)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:761) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:498) 
at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method) 
at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:631) 
at android.view.LayoutInflater.inflate(Native Method) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:398) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:354) 
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287) 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139) 
at net.aafushh.smoky.booking.test.onCreate(test.java:20) 
at android.app.Activity.performCreate(Activity.java:5389) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2256) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2350) 
at android.app.ActivityThread.access$800(ActivityThread.java:163) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1257) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:157) 
at android.app.ActivityThread.main(ActivityThread.java:5335) 
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:1265) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081) 
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132) 
at dalvik.system.NativeStart.main(Native Method) 
Caused by: java.lang.NoSuchMethodError: android.view.View.<init>
at de.ehsun.coloredtimebar.TimelineView.<init>(TimelineView.kt:15)
at de.ehsun.coloredtimebar.TimelinePickerView.<init>(TimelinePickerView.kt:15)
at de.ehsun.coloredtimebar.TimelinePickerView.<init>(TimelinePickerView.kt:14)
at de.ehsun.coloredtimebar.TimelinePickerView.<init>(TimelinePickerView.kt)
at java.lang.reflect.Constructor.constructNative(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 
at android.view.LayoutInflater.createView(LayoutInflater.java:600) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:761) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:498) 
at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method) 
at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:631) 
at android.view.LayoutInflater.inflate(Native Method) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:398) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:354) 
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287) 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139) 
at net.aafushh.smoky.booking.test.onCreate(test.java:20) 
at android.app.Activity.performCreate(Activity.java:5389) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2256) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2350) 
at android.app.ActivityThread.access$800(ActivityThread.java:163) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1257) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:157) 
at android.app.ActivityThread.main(ActivityThread.java:5335) 
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:1265) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081) 
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132) 
at dalvik.system.NativeStart.main(Native Method) 
Someone please help me on this issue. thank you
The minimum sdkversion of de.ehsun.coloredtimebar.TimelinePickerView is 19. so it works fine in kitkat and above versions. It will not work in below versions than kitkat.

Resources$NotFoundException: File res/drawable-hdpi-v4/ic_bluetooth.xml

My app is working fine on api 23.
However in api lower than 19, when I try to open the app, it throws an error, although I don't have an image view in my mainlayout:
04-15 15:46:37.196 25249-25249/io.github.swarajsaaj.otpblogdemo
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity
ComponentInfo{io.github.swarajsaaj.otpblogdemo/io.github.swarajsaaj.INFINITY.bluetoothchat.MainActivity}:
android.view.InflateException: Binary XML file line #39: Error
inflating class android.widget.ImageView
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2255)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2309)
at android.app.ActivityThread.access$700(ActivityThread.java:157)
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1289)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5317)
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:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #39:
Error inflating class android.widget.ImageView
at android.view.LayoutInflater.createView(LayoutInflater.java:619)
at
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:666)
at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:752)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:760)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:760)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:760)
at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at
io.github.swarajsaaj.INFINITY.bluetoothchat.BluetoothChatFragment.onCreateView(BluetoothChatFragment.java:354)
at
android.support.v4.app.Fragment.performCreateView(Fragment.java:2074)
at
android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
at
android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1286)
at
android.support.v4.app.BackStackRecord.run(BackStackRecord.java:758)
at
android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1671)
at
android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:388)
at
android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:619)
at
io.github.swarajsaaj.INFINITY.common.activities.SampleActivityBase.onStart(SampleActivityBase.java:40)
at
android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1181)
at android.app.Activity.performStart(Activity.java:5336)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2227)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2309) 
at android.app.ActivityThread.access$700(ActivityThread.java:157) 
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1289) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:176) 
at android.app.ActivityThread.main(ActivityThread.java:5317) 
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:1102) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) 
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:593)
at
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:666) 
at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:752) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:760) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:760) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:760) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:495) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 
at
io.github.swarajsaaj.INFINITY.bluetoothchat.BluetoothChatFragment.onCreateView(BluetoothChatFragment.java:354) 
at
android.support.v4.app.Fragment.performCreateView(Fragment.java:2074) 
at
android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104) 
at
android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1286) 
at
android.support.v4.app.BackStackRecord.run(BackStackRecord.java:758) 
at
android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1671) 
at
android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:388) 
at
android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:619) 
at
io.github.swarajsaaj.INFINITY.common.activities.SampleActivityBase.onStart(SampleActivityBase.java:40) 
at
android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1181) 
at android.app.Activity.performStart(Activity.java:5336) 
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2227) 
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2309) 
at android.app.ActivityThread.access$700(ActivityThread.java:157) 
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1289) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:176) 
at android.app.ActivityThread.main(ActivityThread.java:5317) 
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:1102) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) 
at dalvik.system.NativeStart.main(Native Method) 
Caused by: android.content.res.Resources$NotFoundException: File
res/drawable-hdpi-v4/ic_bluetooth.xml from drawable resource ID
0x7f020062
at android.content.res.Resources.loadDrawable(Resources.java:2842)
at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
at android.widget.ImageView.<init>(ImageView.java:126)
at android.widget.ImageView.<init>(ImageView.java:116)
at java.lang.reflect.Constructor.constructNative(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:417) 
at android.view.LayoutInflater.createView(LayoutInflater.java:593) 
at
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:666) 
at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:752) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:760) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:760) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:760) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:495) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 
at
io.github.swarajsaaj.INFINITY.bluetoothchat.BluetoothChatFragment.onCreateView(BluetoothChatFragment.java:354) 
at
android.support.v4.app.Fragment.performCreateView(Fragment.java:2074) 
at
android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104) 
at
android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1286) 
at
android.support.v4.app.BackStackRecord.run(BackStackRecord.java:758) 
at
android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1671) 
at
android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:388) 
at
android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:619) 
at
io.github.swarajsaaj.INFINITY.common.activities.SampleActivityBase.onStart(SampleActivityBase.java:40) 
at
android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1181) 
at android.app.Activity.performStart(Activity.java:5336) 
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2227) 
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2309) 
at android.app.ActivityThread.access$700(ActivityThread.java:157) 
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1289) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:176) 
at android.app.ActivityThread.main(ActivityThread.java:5317) 
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:1102) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) 
at dalvik.system.NativeStart.main(Native Method) 
Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line
1: invalid drawable tag vector
at
android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:917)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:858)
at android.content.res.Resources.loadDrawable(Resources.java:2839)
at android.content.res.TypedArray.getDrawable(TypedArray.java:602) 
at android.widget.ImageView.(ImageView.java:126) 
at android.widget.ImageView.(ImageView.java:116) 
at java.lang.reflect.Constructor.constructNative(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:417) 
at android.view.LayoutInflater.createView(LayoutInflater.java:593) 
at
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:666) 
at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:752) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:760) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:760) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:760) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:495) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 
at
io.github.swarajsaaj.INFINITY.bluetoothchat.BluetoothChatFragment.onCreateView(BluetoothChatFragment.java:354) 
at
android.support.v4.app.Fragment.performCreateView(Fragment.java:2074) 
at
android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104) 
at
android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1286) 
at
android.support.v4.app.BackStackRecord.run(BackStackRecord.java:758) 
at
android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1671) 
at
android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:388) 
at
android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:619) 
at
io.github.swarajsaaj.INFINITY.common.activities.SampleActivityBase.onStart(SampleActivityBase.java:40) 
at
android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1181) 
at android.app.Activity.performStart(Activity.java:5336) 
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2227) 
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2309) 
at android.app.ActivityThread.access$700(ActivityThread.java:157) 
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1289) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:176) 
at android.app.ActivityThread.main(ActivityThread.java:5317) 
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:1102) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) 
at dalvik.system.NativeStart.main(Native Method)
I guess APIs below 19 do not support some of the XML that is in your file:
Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #1: invalid drawable tag vector

Android app layout inflating error in below SDK 22

I have two Genymotion devices installed on my PC. One has SDK 19 and the other 22. The example app and the app I'm developing using this library works pretty well on the device with SDK 22. However they both crash on the device with SDK 18. I also have a real device with SDK 19 and they also crash on that device too. The stack trace is as following:
10-07 12:24:12.684 9948-9948/io.github.meness.easyintro.app E/AndroidRuntime: FATAL EXCEPTION: main
Process: io.github.meness.easyintro.app, PID: 9948
java.lang.RuntimeException: Unable to start activity ComponentInfo{io.github.meness.easyintro.app/io.github.meness.easyintro.app.MyEasyIntro}: android.view.InflateException: Binary XML file line #24: Error inflating class io.github.meness.easyintro.views.LeftToggleIndicator
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2235)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2285)
at android.app.ActivityThread.access$800(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1236)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:149)
at android.app.ActivityThread.main(ActivityThread.java:5061)
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:787)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:603)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #24: Error inflating class io.github.meness.easyintro.views.LeftToggleIndicator
at android.view.LayoutInflater.createView(LayoutInflater.java:620)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.support.v7.widget.ViewStubCompat.inflate(ViewStubCompat.java:200)
at io.github.meness.easyintro.EasyIntroCarouselFragment.inflateIndicatorContainer(EasyIntroCarouselFragment.java:732)
at io.github.meness.easyintro.EasyIntroCarouselFragment.onViewCreated(EasyIntroCarouselFragment.java:680)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1086)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:742)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)
at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:339)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:601)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1171)
at android.app.Activity.performStart(Activity.java:5241)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2208)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2285) 
at android.app.ActivityThread.access$800(ActivityThread.java:138) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1236) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:149) 
at android.app.ActivityThread.main(ActivityThread.java:5061) 
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:787) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:603) 
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:423)
at android.view.LayoutInflater.createView(LayoutInflater.java:594)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 
at android.support.v7.widget.ViewStubCompat.inflate(ViewStubCompat.java:200) 
at io.github.meness.easyintro.EasyIntroCarouselFragment.inflateIndicatorContainer(EasyIntroCarouselFragment.java:732) 
at io.github.meness.easyintro.EasyIntroCarouselFragment.onViewCreated(EasyIntroCarouselFragment.java:680) 
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1086) 
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252) 
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:742) 
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617) 
at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:339) 
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:601) 
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1171) 
at android.app.Activity.performStart(Activity.java:5241) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2208) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2285) 
at android.app.ActivityThread.access$800(ActivityThread.java:138) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1236) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:149) 
at android.app.ActivityThread.main(ActivityThread.java:5061) 
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:787) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:603) 
at dalvik.system.NativeStart.main(Native Method) 
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/toggle_indicators_bg.xml from drawable resource ID #0x7f020050
at android.content.res.Resources.loadDrawable(Resources.java:2097)
at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
at android.view.View.<init>(View.java:3554)
at android.widget.ImageView.<init>(ImageView.java:123)
at android.widget.ImageButton.<init>(ImageButton.java:87)
at android.support.v7.widget.AppCompatImageButton.<init>(AppCompatImageButton.java:57)
at io.github.meness.easyintro.views.AbstractToggleIndicator.<init>(AbstractToggleIndicator.java:0)
at io.github.meness.easyintro.views.AbstractToggleIndicator.<init>(AbstractToggleIndicator.java:0)
at io.github.meness.easyintro.views.LeftToggleIndicator.<init>(LeftToggleIndicator.java:0)
at java.lang.reflect.Constructor.constructNative(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 
at android.view.LayoutInflater.createView(LayoutInflater.java:594) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 
at android.support.v7.widget.ViewStubCompat.inflate(ViewStubCompat.java:200) 
at io.github.meness.easyintro.EasyIntroCarouselFragment.inflateIndicatorContainer(EasyIntroCarouselFragment.java:732) 
at io.github.meness.easyintro.EasyIntroCarouselFragment.onViewCreated(EasyIntroCarouselFragment.java:680) 
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1086) 
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252) 
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:742) 
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617) 
at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:339) 
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:601) 
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1171) 
at android.app.Activity.performStart(Activity.java:5241) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2208) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2285) 
at android.app.ActivityThread.access$800(ActivityThread.java:138) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1236) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:149) 
at android.app.ActivityThread.main(ActivityThread.java:5061) 
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:787) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:603) 
at dalvik.system.NativeStart.main(Native Method) 
Caused by: java.lang.UnsupportedOperationException: Can't convert to color: type=0x2
at android.content.res.TypedArray.getColor(TypedArray.java:327)
at android.graphics.drawable.GradientDrawable.inflate(GradientDrawable.java:970)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:937)
at andr
My XML:
<io.github.meness.easyintro.views.LeftToggleIndicator
android:id="#+id/leftIndicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginEnd="5dp"
android:visibility="invisible"
android:layout_marginRight="5dp"
android:background="?attr/toggleIndicatorsBackground"
android:padding="4dp"
android:src="#drawable/ic_keyboard_arrow_left_white_24dp"/>

Recyclerview + Picasso outofmemory error

I am facing issue of outofmemory when using recyclerview and picasso.
Picasso.with(context).load(waterSourcesList.get(position).icon).into(holder.ivSourceIcon);
When moving screen home to second screen and second screen to home screen continuously i am getting following error :
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xyz.android/com.xyz.android.second.SecondActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2201)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2250)
at android.app.ActivityThread.access$900(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1213)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5072)
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:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
at android.view.LayoutInflater.createView(LayoutInflater.java:623)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:672)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697)
at android.view.LayoutInflater.inflate(LayoutInflater.java:472)
at android.view.LayoutInflater.inflate(LayoutInflater.java:400)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at com.madzialipo.android.boreholeNearMe.SecondActivity.onCreate(SecondActivity.java:70)
at android.app.Activity.performCreate(Activity.java:5249)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2165)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2250) 
at android.app.ActivityThread.access$900(ActivityThread.java:141) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1213) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5072) 
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:793) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609) 
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:423)
at android.view.LayoutInflater.createView(LayoutInflater.java:597)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:672) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:472) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:400) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:353) 
at com.madzialipo.android.boreholeNearMe.SecondActivity.onCreate(SecondActivity.java:70) 
at android.app.Activity.performCreate(Activity.java:5249) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2165) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2250) 
at android.app.ActivityThread.access$900(ActivityThread.java:141) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1213) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5072) 
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:793) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609) 
at dalvik.system.NativeStart.main(Native Method) 
Caused by: java.lang.OutOfMemoryError
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:601)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:434)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:840)
at android.content.res.Resources.createFromResourceStream(Resources.java:2513)
at android.content.res.Resources.loadDrawable(Resources.java:2165)
at android.content.res.Resources.loadDrawable(Resources.java:2072)
at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
at android.view.View.<init>(View.java:3562)
at android.view.ViewGroup.<init>(ViewGroup.java:470)
at android.widget.LinearLayout.<init>(LinearLayout.java:176)
at android.widget.LinearLayout.<init>(LinearLayout.java:172)
at java.lang.reflect.Constructor.constructNative(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 
at android.view.LayoutInflater.createView(LayoutInflater.java:597) 
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:672) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:472) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:400) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:353) 
at com.madzialipo.android.boreholeNearMe.SecondActivity.onCreate(SecondActivity.java:70) 
at android.app.Activity.performCreate(Activity.java:5249) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2165) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2250) 
at android.app.ActivityThread.access$900(ActivityThread.java:141) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1213) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5072) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515)
It happened with me because i got project from my colleague in which he used heavy size images in background. So, app crashed. I just removed background images and its done.

Navigation Drawer Activity with Map Fragment : getting crashed

Have used Navigation Drawer Activity (Provided by Android not Custom) and Map Fragment (Support Fragment) in same activity.
The app is working fine for OS version 5 and above.
But app get crashed for OS version less than 5 (Have checked on version 4.4, 4.2)
crash Log showing error at line setContentView(R.layout.HomeActivity);
Log:
android.view.InflateException: Binary XML file line #16: Error inflating class android.support.design.widget.NavigationView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2338)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5292)
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:824)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #16: Error inflating class android.support.design.widget.NavigationView
at android.view.LayoutInflater.createView(LayoutInflater.java:620)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
at com.example.Activities.HomeActivity.onCreate(HomeActivity.java:140)
at android.app.Activity.performCreate(Activity.java:5264)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2302)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390) 
at android.app.ActivityThread.access$800(ActivityThread.java:151) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321) 
at android.os.Handler.dispatchMessage(Handler.java:110) 
at android.os.Looper.loop(Looper.java:193) 
at android.app.ActivityThread.main(ActivityThread.java:5292) 
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:824) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640) 
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:423)
at android.view.LayoutInflater.createView(LayoutInflater.java:594)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:353) 
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256) 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109) 
at com.example.Activities.HomeActivity.onCreate(HomeActivity.java:140) 
at android.app.Activity.performCreate(Activity.java:5264) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2302) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390) 
at android.app.ActivityThread.access$800(ActivityThread.java:151) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321) 
at android.os.Handler.dispatchMessage(Handler.java:110) 
at android.os.Looper.loop(Looper.java:193) 
...
As you can see in first line, problem in your XML file in layout. Just check, maybe you use parameters, which supported only from Android 5 and higher. You have to remove or replace that parameters, to another.
If you use Android Studio, that line should be highlighted with some message. Read more about it - not supported elements.
Binary XML file line #16

Categories

Resources