According to the logcat, you have an ImageView that references a resource
that is not a Drawable.

Perhaps this resource is missing for a particular configuration, perhaps you
have a reference to an android:drawable that's not guaranteed to exist in
the SDK?
15.03.2011 1:20 пользователь "acr" <[email protected]> написал:
> after making the changes, the user is still getting a force close.. I
> had them download aLogCat and run my app and email me the log.. below
> is a snippet of what they sent.
>
> I am having trouble pin pointing the issue, the only line Ithat stands
> out to me is
> at com.myco.myappfree.SplashScreen.onCreate(SplashScreen.java:17)
>
> which line 17 is
> setContentView(R.layout.splash);
>
> does anyone see anything I may be missing here.
>
> I have a layout and a layout-land folder in my package and only the
> layout folder has splash.xml because I am forcing the portrait
> orientation.. Do I even need the layout-land folder at all?
>
> thanks
>
> ....
> I/ActivityManager( 87): Starting activity: Intent
> { action=android.intent.action.MAIN
> categories={android.intent.category.LAUNCHER} flags=0x10200000
> comp={com.myco.myappfree/com.myco.myappfree.SplashScreen} }
> I/ActivityManager( 87): Start proc com.myco.myappfree for activity
> com.myco.myappfree/.SplashScreen: pid=3197 uid=10057 gids={3003}
> W/AudioFlinger( 53): write blocked for 212 msecs
> I/PowerManagerService( 87): keypad run :false:0:0
> I/PowerManagerService( 87): keypad run :false:0:0
> I/global ( 3197): Default buffer size used in BufferedReader
> constructor. It would be better to be explicit if an 8k-char buffer is
> required.
> I/ActivityManager( 87): Process android.process.media (pid 2858) has
> died.
> W/ResourceType( 3197): Failure getting entry for 0x7f020045 (t=1 e=69)
> in package 0: 0xffffffb5
> W/dalvikvm( 3197): threadid=3: thread exiting with uncaught exception
> (group=0x4000ff28)
> E/AndroidRuntime( 3197): Uncaught handler: thread main exiting due to
> uncaught exception
> E/AndroidRuntime( 3197): java.lang.RuntimeException: Unable to start
> activity ComponentInfo{com.myco.myappfree/
> com.myco.myappfree.SplashScreen}: android.view.InflateException:
> Binary XML file line #6: Error inflating class
> java.lang.reflect.Constructor
> E/AndroidRuntime( 3197): at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> 2297)
> E/AndroidRuntime( 3197): at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
> 2313)
> E/AndroidRuntime( 3197): at android.app.ActivityThread.access
> $2000(ActivityThread.java:115)
> E/AndroidRuntime( 3197): at android.app.ActivityThread
> $H.handleMessage(ActivityThread.java:1721)
> E/AndroidRuntime( 3197): at
> android.os.Handler.dispatchMessage(Handler.java:99)
> E/AndroidRuntime( 3197): at android.os.Looper.loop(Looper.java:123)
> E/AndroidRuntime( 3197): at
> android.app.ActivityThread.main(ActivityThread.java:3977)
> E/AndroidRuntime( 3197): at
> java.lang.reflect.Method.invokeNative(Native Method)
> E/AndroidRuntime( 3197): at
> java.lang.reflect.Method.invoke(Method.java:521)
> E/AndroidRuntime( 3197): at com.android.internal.os.ZygoteInit
> $MethodAndArgsCaller.run(ZygoteInit.java:782)
> E/AndroidRuntime( 3197): at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
> E/AndroidRuntime( 3197): at dalvik.system.NativeStart.main(Native
> Method)
> E/AndroidRuntime( 3197): Caused by: android.view.InflateException:
> Binary XML file line #6: Error inflating class
> java.lang.reflect.Constructor
> E/AndroidRuntime( 3197): at
> android.view.LayoutInflater.createView(LayoutInflater.java:512)
> E/AndroidRuntime( 3197): at
>
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:
> 56)
> E/AndroidRuntime( 3197): at
> android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)
> E/AndroidRuntime( 3197): at
> android.view.LayoutInflater.rInflate(LayoutInflater.java:617)
> E/AndroidRuntime( 3197): at
> android.view.LayoutInflater.inflate(LayoutInflater.java:407)
> E/AndroidRuntime( 3197): at
> android.view.LayoutInflater.inflate(LayoutInflater.java:320)
> E/AndroidRuntime( 3197): at
> android.view.LayoutInflater.inflate(LayoutInflater.java:276)
> E/AndroidRuntime( 3197): at
>
com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:
> 313)
> E/AndroidRuntime( 3197): at
> android.app.Activity.setContentView(Activity.java:1683)
> E/AndroidRuntime( 3197): at
> com.myco.myappfree.SplashScreen.onCreate(SplashScreen.java:17)
> E/AndroidRuntime( 3197): at
> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
> 1123)
> E/AndroidRuntime( 3197): at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> 2260)
> E/AndroidRuntime( 3197): ... 11 more
> E/AndroidRuntime( 3197): Caused by:
> java.lang.reflect.InvocationTargetException
> E/AndroidRuntime( 3197): at
> android.widget.ImageView.<init>(ImageView.java:128)
> E/AndroidRuntime( 3197): at
> java.lang.reflect.Constructor.constructNative(Native Method)
> E/AndroidRuntime( 3197): at
> java.lang.reflect.Constructor.newInstance(Constructor.java:446)
> E/AndroidRuntime( 3197): at
> android.view.LayoutInflater.createView(LayoutInflater.java:499)
> E/AndroidRuntime( 3197): ... 22 more
> E/AndroidRuntime( 3197): Caused by: android.content.res.Resources
> $NotFoundException: Resource is not a Drawable (color or path):
> TypedValue{t=0x1/d=0x7f020045 a=-1 r=0x7f020045}
> E/AndroidRuntime( 3197): at
> android.content.res.Resources.loadDrawable(Resources.java:1611)
> E/AndroidRuntime( 3197): at
> android.content.res.TypedArray.getDrawable(TypedArray.java:548)
> E/AndroidRuntime( 3197): at
> android.widget.ImageView.<init>(ImageView.java:138)
> E/AndroidRuntime( 3197): ... 26 more
> E/QC-DSS-LIB( 50): unrecognized ifindex 7
> I/wpa_supplicant( 126): CTRL-EVENT-SCAN-RESULTS Ready
> E/QC-DSS-LIB( 50): unrecognized ifindex 7
> I/wpa_supplicant( 126): CTRL-EVENT-SCAN-RESULTS Ready
> W/ActivityManager( 87): Launch timeout has expired, giving up wake
> lock!
> W/ActivityManager( 87): Activity idle timeout for
> HistoryRecord{437b9dd8 {com.myco.myappfree/
> com.myco.myappfree.SplashScreen}}
> E/QC-DSS-LIB( 50): unrecognized ifindex 7
> I/wpa_supplicant( 126): CTRL-EVENT-SCAN-RESULTS Ready
> E/QC-DSS-LIB( 50):
>
> ....
>
> I/ActivityManager( 87): Starting activity: Intent
> { action=android.intent.action.MAIN
> categories={android.intent.category.LAUNCHER} flags=0x10200000
> comp={com.myco.myappfree/com.myco.myappfree.SplashScreen} }
> I/ActivityManager( 87): Start proc com.myco.myappfree for activity
> com.myco.myappfree/.SplashScreen: pid=3345 uid=10057 gids={3003}
> I/PowerManagerService( 87): keypad run :false:0:0
> I/PowerManagerService( 87): keypad run :false:0:0
> I/global ( 3345): Default buffer size used in BufferedReader
> constructor. It would be better to be explicit if an 8k-char buffer is
> required.
> W/ResourceType( 3345): Failure getting entry for 0x7f020045 (t=1 e=69)
> in package 0: 0xffffffb5
> W/dalvikvm( 3345): threadid=3: thread exiting with uncaught exception
> (group=0x4000ff28)
> E/AndroidRuntime( 3345): Uncaught handler: thread main exiting due to
> uncaught exception
> E/AndroidRuntime( 3345): java.lang.RuntimeException: Unable to start
> activity ComponentInfo{com.myco.myappfree/
> com.myco.myappfree.SplashScreen}: android.view.InflateException:
> Binary XML file line #6: Error inflating class
> java.lang.reflect.Constructor
> E/AndroidRuntime( 3345): at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> 2297)
> E/AndroidRuntime( 3345): at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
> 2313)
> E/AndroidRuntime( 3345): at android.app.ActivityThread.access
> $2000(ActivityThread.java:115)
> E/AndroidRuntime( 3345): at android.app.ActivityThread
> $H.handleMessage(ActivityThread.java:1721)
> E/AndroidRuntime( 3345): at
> android.os.Handler.dispatchMessage(Handler.java:99)
> E/AndroidRuntime( 3345): at android.os.Looper.loop(Looper.java:123)
> E/AndroidRuntime( 3345): at
> android.app.ActivityThread.main(ActivityThread.java:3977)
> E/AndroidRuntime( 3345): at
> java.lang.reflect.Method.invokeNative(Native Method)
> E/AndroidRuntime( 3345): at
> java.lang.reflect.Method.invoke(Method.java:521)
> E/AndroidRuntime( 3345): at com.android.internal.os.ZygoteInit
> $MethodAndArgsCaller.run(ZygoteInit.java:782)
> E/AndroidRuntime( 3345): at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
> E/AndroidRuntime( 3345): at dalvik.system.NativeStart.main(Native
> Method)
> E/AndroidRuntime( 3345): Caused by: android.view.InflateException:
> Binary XML file line #6: Error inflating class
> java.lang.reflect.Constructor
> E/AndroidRuntime( 3345): at
> android.view.LayoutInflater.createView(LayoutInflater.java:512)
> E/AndroidRuntime( 3345): at
>
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:
> 56)
> E/AndroidRuntime( 3345): at
> android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)
> E/AndroidRuntime( 3345): at
> android.view.LayoutInflater.rInflate(LayoutInflater.java:617)
> E/AndroidRuntime( 3345): at
> android.view.LayoutInflater.inflate(LayoutInflater.java:407)
> E/AndroidRuntime( 3345): at
> android.view.LayoutInflater.inflate(LayoutInflater.java:320)
> E/AndroidRuntime( 3345): at
> android.view.LayoutInflater.inflate(LayoutInflater.java:276)
> E/AndroidRuntime( 3345): at
>
com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:
> 313)
> E/AndroidRuntime( 3345): at
> android.app.Activity.setContentView(Activity.java:1683)
> E/AndroidRuntime( 3345): at
> com.myco.myappfree.SplashScreen.onCreate(SplashScreen.java:17)
> E/AndroidRuntime( 3345): at
> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
> 1123)
> E/AndroidRuntime( 3345): at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> 2260)
> E/AndroidRuntime( 3345): ... 11 more
> E/AndroidRuntime( 3345): Caused by:
> java.lang.reflect.InvocationTargetException
> E/AndroidRuntime( 3345): at
> android.widget.ImageView.<init>(ImageView.java:128)
> E/AndroidRuntime( 3345): at
> java.lang.reflect.Constructor.constructNative(Native Method)
> E/AndroidRuntime( 3345): at
> java.lang.reflect.Constructor.newInstance(Constructor.java:446)
> E/AndroidRuntime( 3345): at
> android.view.LayoutInflater.createView(LayoutInflater.java:499)
> E/AndroidRuntime( 3345): ... 22 more
> E/AndroidRuntime( 3345): Caused by: android.content.res.Resources
> $NotFoundException: Resource is not a Drawable (color or path):
> TypedValue{t=0x1/d=0x7f020045 a=-1 r=0x7f020045}
> E/AndroidRuntime( 3345): at
> android.content.res.Resources.loadDrawable(Resources.java:1611)
> E/AndroidRuntime( 3345): at
> android.content.res.TypedArray.getDrawable(TypedArray.java:548)
> E/AndroidRuntime( 3345): at
> android.widget.ImageView.<init>(ImageView.java:138)
> E/AndroidRuntime( 3345): ... 26 more
> E/QC-DSS-LIB( 50): unrecognized ifindex 7
> I/wpa_supplicant( 126): CTRL-EVENT-SCAN-RESULTS Ready
> E/QC-DSS-LIB( 50): unrecognized ifindex 7
> I/wpa_supplicant( 126): CTRL-EVENT-SCAN-RESULTS Ready
> W/ActivityManager( 87): Launch timeout has expired, giving up wake
> lock!
> W/ActivityManager( 87): Activity idle timeout for
> HistoryRecord{43804168 {com.myco.myappfree/
> com.myco.myappfree.SplashScreen}}
> E/QC-DSS-LIB( 50): unrecognized ifindex 7
> I/wpa_supplicant( 126): CTRL-EVENT-SCAN-RESULTS Ready
> I/ActivityManager( 87): Process com.myco.myappfree (pid 3345) has
> died.
>
> On Mar 14, 1:45 am, acr <[email protected]> wrote:
>> makes perfect sense, thank you so much  for the help
>>
>> On Mar 14, 1:41 am, Dianne Hackborn <[email protected]> wrote:
>>
>> > Screen orientation is global; there can be various ways in which an
activity
>> > can run briefly in an orientation it doesn't request.  A big example:
if the
>> > device has a lock screen that forces a particular orientation (it is
common
>> > on phones to force portrait), then when the device locks that will take
>> > charge of the screen orientation and force it into the mode it wants
despite
>> > your wishes.
>>
>> > On Sun, Mar 13, 2011 at 9:49 PM, acr <[email protected]> wrote:
>> > > thanks for the quick replies, I did have a lingering layout-land
>> > > folder with a main.xml with generic buttons not the "howtoplay"
>> > > button.. i never gave this much thought because I have the layout set
>> > > to force portrait layout. ie. android:screenOrientation="portrait"..
i
>> > > think this is where my problem lies, but why would it look for that
>> > > folder if i have it set to portrait.. thanks again for the replies
and
>> > > insight
>>
>> > > On Mar 14, 12:31 am, Brill Pappin <[email protected]> wrote:
>> > > > Well its pretty clear from your stack trace and code that sometimes
>> > > > the howtoplayButton is null.
>> > > > If its working most of the time, are you sure you don't have
multiple
>> > > > layouts of the same view?
>> > > > Double check that *all* versions of R.layout.main in your app
contain
>> > > > the button.
>>
>> > > > in fact, search for "howtoplayButton" in main.xml and see what you
>> > > > come up with... every one will need that button, or you need to
handle
>> > > > cases when it doesn't.
>>
>> > > > - Brill Pappin
>>
>> > > > On Mar 13, 11:40 pm, acr <[email protected]> wrote:
>>
>> > > > > sorry for got to add this..
>>
>> > > > > 53:    howtoplayButton.setOnClickListener(this);
>>
>> > > > > this works on 99.9 percent of devices
>>
>> > > > > here's a larger snippet:
>> > > > > @Override
>> > > > >         public voidonCreate(Bundle savedInstanceState) {
>> > > > >                 super.onCreate(savedInstanceState);
>> > > > >                 setContentView(R.layout.main);
>>
>> > > > >
setVolumeControlStream(AudioManager.STREAM_MUSIC);
>> > > > >                 //Get Screen Width
>> > > > >                 Panel.screenWidth =
>> > > > > getWindowManager().getDefaultDisplay().getWidth();
>> > > > >                 // Set up click listeners for all the buttons
>> > > > >                 //View continueButton =
>> > > findViewById(R.id.continue_button);
>> > > > >                 //continueButton.setOnClickListener(this);
>> > > > >                 View newButton = findViewById(R.id.new_button);
>> > > > >                 newButton.setOnClickListener(this);
>> > > > >                 View aboutButton =
findViewById(R.id.about_button);
>> > > > >                 aboutButton.setOnClickListener(this);
>> > > > >                 View howtoplayButton =
>> > > findViewById(R.id.howtoplay_button);
>> > > > >                 howtoplayButton.setOnClickListener(this);
>> > > > >                 View exitButton = findViewById(R.id.exit_button);
>> > > > >                 exitButton.setOnClickListener(this);
>> > > > >                 View buyButton = findViewById(R.id.buy_full);
>> > > > >                 buyButton.setOnClickListener(this);
>>
>> > > newButton.startAnimation(AnimationUtils.loadAnimation(this,
>> > > > > R.anim.shake));
>> > > > > ......
>>
>> > > > > On Mar 13, 11:30 pm, Dianne Hackborn <[email protected]> wrote:
>>
>> > > > > > Given this:
>>
>> > > > > > Caused by: java.lang.NullPointerExceptionat
>> > > > > > com.myco.myappfree.myapp.onCreate(myapp.java:53)
>> > > > > > at
>> > >
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
>> > > > > > at
>> > >
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
>>
>> > > > > > What is on line 53 of your app?
>>
>> > > > > > On Sun, Mar 13, 2011 at 8:03 PM, acr <[email protected]> wrote:
>> > > > > > > I have a relatively successful app in the android market that
a
>> > > very
>> > > > > > > small amount of users experience force close on start up of
the
>> > > app.
>>
>> > > > > > > It is not happening on a specific device, im not sure if it's
>> > > > > > > something these users have installed that is interfering with
the
>> > > app.
>> > > > > > > I've tried to troubleshoot with a few users having the
problem, but
>> > > > > > > cannot get to the bottom of it.
>>
>> > > > > > > it happens on both rooted and non-rooted phones
>>
>> > > > > > > I keep getting aNullPointerExceptionfor a small number of
users
>> > > who
>> > > > > > > use a variety of phones that normally work.
>> > > > > > > anyone know what may be causing this, or how to get around
this? I
>> > > > > > > can't figure this one out and cannot replicate the problem,
please
>> > > > > > > help.
>>
>> > > > > > > below are the stack traces from the market (package name
changed to
>> > > > > > > not spam the board)
>>
>> > > > > > > java.lang.RuntimeException: Unable to start activity
>> > > > > > > ComponentInfo{com.myco.myappfree/com.myco.myappfree.myapp}:
>> > > > > > > java.lang.NullPointerException
>> > > > > > > at
>>
>> > > android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
>> > > > > > > 2663)
>> > > > > > > at
>> > > android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
>> > > > > > > 2679)
>> > > > > > > at
android.app.ActivityThread.access$2300(ActivityThread.java:125)
>> > > > > > > at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:
>> > > > > > > 2033)
>> > > > > > > at android.os.Handler.dispatchMessage(Handler.java:99)
>> > > > > > > at android.os.Looper.loop(Looper.java:123)
>> > > > > > > at android.app.ActivityThread.main(ActivityThread.java:4627)
>> > > > > > > at java.lang.reflect.Method.invokeNative(Native Method)
>> > > > > > > at java.lang.reflect.Method.invoke(Method.java:521)
>> > > > > > > at com.android.internal.os.ZygoteInit
>> > > > > > > $MethodAndArgsCaller.run(ZygoteInit.java:858)
>> > > > > > > at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
>> > > > > > > at dalvik.system.NativeStart.main(Native Method)
>> > > > > > > Caused by: java.lang.NullPointerException
>> > > > > > > at com.myco.myappfree.myapp.onCreate(myapp.java:53)
>> > > > > > > at
>>
>> > >
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
>> > > > > > > 1047)
>> > > > > > > at
>>
>> > > android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
>> > > > > > > 2627)
>> > > > > > > ... 11 more
>>
>> > > > > > > --
>> > > > > > > You received this message because you are subscribed to the
Google
>> > > > > > > Groups "Android Developers" group.
>> > > > > > > To post to this group, send email to
>> > > [email protected]
>> > > > > > > To unsubscribe from this group, send email to
>> > > > > > > [email protected]
>> > > > > > > For more options, visit this group at
>> > > > > > >http://groups.google.com/group/android-developers?hl=en
>>
>> > > > > > --
>> > > > > > Dianne Hackborn
>> > > > > > Android framework engineer
>> > > > > > [email protected]
>>
>> > > > > > Note: please don't send private questions to me, as I don't
have time
>> > > to
>> > > > > > provide private support, and so won't reply to such e-mails.
 All
>> > > such
>> > > > > > questions should be posted on public forums, where I and others
can
>> > > see and
>> > > > > > answer them.
>>
>> > > --
>> > > You received this message because you are subscribed to the Google
>> > > Groups "Android Developers" group.
>> > > To post to this group, send email to
[email protected]
>> > > To unsubscribe from this group, send email to
>> > > [email protected]
>> > > For more options, visit this group at
>> > >http://groups.google.com/group/android-developers?hl=en
>>
>> > --
>> > Dianne Hackborn
>> > Android framework engineer
>> > [email protected]
>>
>> > Note: please don't send private questions to me, as I don't have time
to
>> > provide private support, and so won't reply to such e-mails.  All such
>> > questions should be posted on public forums, where I and others can see
and
>> > answer them.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to