Android drawable lookup issue - android

I'm experiencing an odd behaviour in my Android app. I have a drawable , walkthrough_safe.png and have a version in drawable-mdpi, drawable-hdpi and drawable-xhdpi folders.
I'm seeing this crash in analytics
{main} android.view.InflateException: Binary XML file line #7: Error inflating class
<unknown> at android.view.LayoutInflater.createView(LayoutInflater.java:613) at
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:
56) at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660) at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685) at
android.view.LayoutInflater.rInflate(LayoutInflater.java:746) at
android.view.LayoutInflater.inflate(LayoutInflater.java:489) at
android.view.LayoutInflater.inflate(LayoutInflater.java:396) at
com.a.b.activity.WalkThroughLoginActivity$WalkthroughFragment.onCreateView(WalkThroughLoginA
ctivity.java:247) at android.support.v4.app.Fragment.performCreateView(Fragment.java:1504)
at android.support.v4.app.y.a(FragmentManager.java:942) at
android.support.v4.app.y.a(FragmentManager.java:1121) at
android.support.v4.app.l.run(BackStackRecord.java:682) at
android.support.v4.app.y.d(FragmentManager.java:1484) at
android.support.v4.app.y.b(FragmentManager.java:482) at
android.support.v4.app.ad.finishUpdate(FragmentPagerAdapter.java:141) at
android.support.v4.view.ViewPager.a(ViewPager.java:1073) at
android.support.v4.view.ViewPager.b(ViewPager.java:919) at
android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1441) at
android.view.View.measure(View.java:15264) at
android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:617) at
android.widget.RelativeLayout.onMeasure(RelativeLayout.java:399) at
android.view.View.measure(View.java:15264) at
android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4916) at
android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at
android.view.View.measure(View.java:15264) at
android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4916) at
android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1390) at
android.widget.LinearLayout.measureVertical(LinearLayout.java:681) at
android.widget.LinearLayout.onMeasure(LinearLayout.java:574) at
android.view.View.measure(View.java:15264) at
android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4916) at
android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at
android.view.View.measure(View.java:15264) at
android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4916) at
android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1390) at
android.widget.LinearLayout.measureVertical(LinearLayout.java:681) at
android.widget.LinearLayout.onMeasure(LinearLayout.java:574) at
android.view.View.measure(View.java:15264) at
android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4916) at
android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at
com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2339) at
android.view.View.measure(View.java:15264) at
android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2131) at
android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1242) at
android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1435) at
android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1127) at
android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4606) at
android.view.Choreographer$CallbackRecord.run(Choreographer.java:747) at
android.view.Choreographer.doCallbacks(Choreographer.java:567) at
android.view.Choreographer.doFrame(Choreographer.java:536) at
android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:733) at
android.os.Handler.handleCallback(Handler.java:615) at
android.os.Handler.dispatchMessage(Handler.java:92) at
android.os.Looper.loop(Looper.java:153) at
android.app.ActivityThread.main(ActivityThread.java:5006) 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:821) at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584) 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:587) ... 59 more Caused by:
android.content.res.Resources$NotFoundException: File res/drawable-mdpi-
v4/walkthrough_safe.png from drawable resource ID #0x7f02015c at
android.content.res.Resources.loadDrawable(Resources.java:2054) at
android.content.res.TypedArray.getDrawable(TypedArray.java:601) at android.widget.ImageView.
<init>(ImageView.java:120) at android.widget.ImageView.<init>(ImageView.java:110) ... 62
more Caused by: java.io.FileNotFoundException: res/drawable-mdpi-v4/walkthrough_safe.png at
android.content.res.AssetManager.openNonAssetNative(Native Method) at
android.content.res.AssetManager.openNonAsset(AssetManager.java:410) at
android.content.res.Resources.loadDrawable(Resources.java:2046) ... 65 more
In the line WalkThroughLoginActivity.java:247 I have this:
inflater.inflate(R.layout.fragment_login_walkthrough_2,
container, false);
And this is the layout file for fragment_login_walkthrough_2.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
style="#style/icon_walkthrough"
android:src="#drawable/walkthrough_safe" />
<TextView
style="#style/title_walkthrough"
android:layout_marginTop="#dimen/margin_walktrough_title"
android:text="#string/walkthrough2_title" />
<TextView
style="#style/text_walkthrough"
android:text="#string/walkthrough2_subtitle"/>
</LinearLayout>
Please correctly if I'm wrong but it seems to me that android is looking up for my drawable in the wrong folder (drawable-mdpi-v4), which obvioulsy does not exist. Not only that, after not finding it, it is not falling back to a more general folder, such us drawable-mdpi.
Have I missed something?

Related

ArrayMap api level 16 [duplicate]

I get an error in my code with this logcat:
java.lang.NoClassDefFoundError: android.util.ArrayMap
at it.dd.multiplayerit.MainActivity.<init>(MainActivity.java:88)
at it.dd.multiplayerit.SwipeMainFragment$SectionsPagerAdapter.getItem(SwipeMainFragment.java:200)
at android.support.v4.app.FragmentPagerAdapter.instantiateItem(FragmentPagerAdapter.java:97)
at android.support.v4.view.ViewPager.addNewItem(ViewPager.java:832)
at android.support.v4.view.ViewPager.populate(ViewPager.java:982)
at android.support.v4.view.ViewPager.populate(ViewPager.java:914)
at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1436)
at android.view.View.measure(View.java:15284)
at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.onMeasure(CustomViewAbove.java:456)
at android.view.View.measure(View.java:15284)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:665)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:447)
at android.view.View.measure(View.java:15284)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4816)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.view.View.measure(View.java:15284)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:861)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:602)
at android.view.View.measure(View.java:15284)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4816)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2367)
at android.view.View.measure(View.java:15284)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1867)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1111)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1292)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1009)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4236)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
at android.view.Choreographer.doCallbacks(Choreographer.java:555)
at android.view.Choreographer.doFrame(Choreographer.java:525)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4872)
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:790)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at dalvik.system.NativeStart.main(Native Method)
I think that the problem is the autocompletetextview i created. I mapped the array to get the position of array when i click in the dropdown during type what i want search.
At line 88 i have this:
ArrayMap<String, Integer>myArrayMap = new ArrayMap<String, Integer>();
The crash seems to be only with android 4.1 version. Is there any incompatibility?
ArrayMap was introduced in Api level 19, but it was also released in the compatibility library v4, so it would be enough to change the import to android.support.v4.util.ArrayMap instead of android.util.ArrayMap
For now it migrates to AndroidX.
Instead of android.util.ArrayMap you will write androidx.collection.ArrayMap

java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.LinearLayout$LayoutParams android 4.1.2

I have this Exception only on some devices on android 4.1.2. So, I want to know what is the problem it can be.
Here is stack trace - no one line from my code, only from SDK - exception happens in SDK, so no lines were missed:
java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to
android.widget.LinearLayout$LayoutParams
at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:996)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:576)
at android.view.View.measure(View.java:15563)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:617)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:399)
at android.view.View.measure(View.java:15563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5112)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.view.View.measure(View.java:15563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5112)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1396)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:681)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:574)
at android.view.View.measure(View.java:15563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5112)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2423)
at android.view.View.measure(View.java:15563)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2003)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1242)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1417)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1135)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4653)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
at android.view.Choreographer.doCallbacks(Choreographer.java:555)
at android.view.Choreographer.doFrame(Choreographer.java:525)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4944)
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:1038)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
at dalvik.system.NativeStart.main(Native Method)
In your code you are importing import android.widget.LinearLayout.LayoutParams instead of android.view.ViewGroup.LayoutParams;
so Delete import android.widget.LinearLayout.LayoutParams;
and Add import android.view.ViewGroup.LayoutParams;

Android: Having force close when accessing the media store

I seems to receive a force close when turning off the phone and turning back on and when I on to the application which require to load the photos with media store , it force close. It has no problem when I wait for awhile before going to the application. Do I need to check anything before using the media store.
The error below may or may not related I don't actually sure.
Log
java.lang.IllegalStateException: couldn't move cursor to position 0
at android.widget.CursorAdapter.getView(CursorAdapter.java:242)
at android.widget.AbsListView.obtainView(AbsListView.java:2472)
at android.widget.GridView.onMeasure(GridView.java:1030)
at android.view.View.measure(View.java:15563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5112)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1396)
at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1038)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:576)
at android.view.View.measure(View.java:15563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5112)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1396)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:681)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:574)
at android.view.View.measure(View.java:15563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5112)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.view.View.measure(View.java:15563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5112)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1396)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:681)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:574)
at android.view.View.measure(View.java:15563)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5112)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2411)
at android.view.View.measure(View.java:15563)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2003)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1242)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1417)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1135)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4652)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
at android.view.Choreographer.doCallbacks(Choreographer.java:555)
at android.view.Choreographer.doFrame(Choreographer.java:525)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4944)
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:1038)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
at dalvik.system.NativeStart.main(Native Method)

how to use custom ImageView

I have found the following code on how to get display height and width from ImageView: Trying to get the display size of an image in an ImageView . When I try to use it in the layout snippet below, I get following error.
<com.mycompany.widget.SizeAwareImageView
android:id="#+id/account_profile_img"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="#drawable/avatar"
android:clickable="true"
android:gravity="bottom|center_horizontal"
android:onClick="onEditPhotoClicked" />
ERROR:
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.company.myapp/com.company.myapp.RegisterActivity}: android.view.InflateException: Binary XML file line #218: Error inflating class com.company.myapp.widget.SizeAwareImageView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2247)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2297)
at android.app.ActivityThread.access$700(ActivityThread.java:152)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1282)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5328)
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 #218: Error inflating class com.company.myapp.widget.SizeAwareImageView
at android.view.LayoutInflater.createView(LayoutInflater.java:602)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:693)
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 android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:327)
at android.app.Activity.setContentView(Activity.java:1928)
at com.company.myapp.RegisterActivity.onCreate(RegisterActivity.java:63)
at android.app.Activity.performCreate(Activity.java:5250)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
... 11 more
Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context, interface android.util.AttributeSet]
at java.lang.Class.getConstructorOrMethod(Class.java:460)
at java.lang.Class.getConstructor(Class.java:431)
at android.view.LayoutInflater.createView(LayoutInflater.java:567)
... 25 more
UPDATE
From the graphics Layout I also get the error
java.lang.NullPointerException
Exception details are logged in Window > Show View > Error Log
java.lang.NullPointerException
at com.company.myapp.widget.SizeAwareImageView.onMeasure(SizeAwareImageView.java:66)
at android.view.View.measure(View.java:15848)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5008)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404)
at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1052)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:590)
at android.view.View.measure(View.java:15848)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5008)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
at android.view.View.measure(View.java:15848)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:728)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:477)
at android.view.View.measure(View.java:15848)
at android.widget.ScrollView.measureChildWithMargins(ScrollView.java:1217)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.widget.ScrollView.onMeasure(ScrollView.java:321)
at android.view.View.measure(View.java:15848)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5008)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.view.View.measure(View.java:15848)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5008)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
at android.view.View.measure(View.java:15848)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5008)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
at android.view.View.measure(View.java:15848)
SECOND UPDATE
the errored line in question is the second of
final Drawable d = getDrawable();
final int origW = d.getIntrinsicWidth();
final int origH = d.getIntrinsicHeight();
The complete code is here on stack overflow at Trying to get the display size of an image in an ImageView . It's the response with the most votes.
Make sure you have provided the right constructor for the XML. Your custom Views constructor should have the following method signature:
public SizeAwareImageView(Context context, AttributeSet attrs){
// todo
}
I'm guessing it currently looks like this:
public SizeAwareImageView(Context context){
// todo
}
Also I'd double check you meant to set the XML parameter android:background, for ImageView you actually set android:src.

Layout inflater error when loading app

I have a Galaxy Samsung tab 10.1" Model GT-P7510 OS Version 3.2. I tried to load app on it and it's giving me Layout inflater error. Why is this? Here is what logcat says:
android.view.InflateException: Binary XML file line #12: Error inflating class <unknown>
at android.view.LayoutInflater.createView(LayoutInflater.java:596)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:644)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:669)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:724)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
at android.view.LayoutInflater.inflate(LayoutInflater.java:391)
at android.view.LayoutInflater.inflate(LayoutInflater.java:347)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:245)
at android.app.Activity.setContentView(Activity.java:1786)
at com.businessplan.BusinessPlannerActivity.onCreate(BusinessPlannerActivity.java:64)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1050)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1782)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1834)
at android.app.ActivityThread.access$500(ActivityThread.java:122)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1027)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:132)
at android.app.ActivityThread.main(ActivityThread.java:4126)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:491)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
at dalvik.system.NativeStart.main(Native Method)
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:416)
at android.view.LayoutInflater.createView(LayoutInflater.java:576)
android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f020022 a=-1 r=0x7f020022}
at android.content.res.Resources.loadDrawable(Resources.java:1890)
at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
at android.view.View.<init>(View.java:2462)
at android.view.ViewGroup.<init>(ViewGroup.java:365)
at android.widget.LinearLayout.<init>(LinearLayout.java:156)
at android.widget.LinearLayout.<init>(LinearLayout.java:152)
Probably you have an error in the layout file called here:
android.app.Activity.setContentView(Activity.java:1786) at com.businessplan.BusinessPlannerActivity.onCreate(BusinessPlannerActivity.java:64) at
Please check it yourself, or post it here.
I removed Gen folder and then again clean and build project and the error has gone.
Same, error went away after a clean project and do a rebuild.

Categories

Resources