Black screen, non-responsive app, when Map loads

247 views
Skip to first unread message

eeVoskos

unread,
Dec 22, 2011, 10:55:39 AM12/22/11
to Android Compatibility Library for Google Maps - Support
Hi,

I am having this problem on a 2.1 emulator and some devices running
2.2. When an activity that extends FragmentActivity starts, the screen
goes black and the app is not responsive.

The logcat does not reveal much information. I do get the following:

I/dalvikvm(477): Could not find method android.view.Window.hasFeature,
referenced from method
android.support.v4.app.FragmentMapActivity.hasFeature
W/dalvikvm(477): VFY: unable to resolve virtual method 2664: Landroid/
view/Window;.hasFeature (I)Z
D/dalvikvm(477): VFY: replacing opcode 0x6e at 0x000a
D/dalvikvm(477): Making a copy of Landroid/support/v4/app/
FragmentMapActivity;.hasFeature code (76 bytes)
E/ActivityThread(477): Failed to find provider info for
com.google.settings

No error, force close or anything. Just black screen and this log.

Please let me know if anyone else has this problem and has found a
workaround. It's the only thing keeping this library away from
commercial use. Otherwise, it's a great piece of work.

Thanks,
Stratos

Pete Doyle

unread,
Dec 22, 2011, 7:13:57 PM12/22/11
to android-support-v4...@googlegroups.com
Hi Stratos,
I'm pretty sure you're using Taro Kobayashi's fork [1] considering my original [2] doesn't have a FragmentMapActivity.  I'm not sure if he's listening here or not so you might have better luck submitting a Github issue on his fork or asking on him (@9re) on twitter.

It looks like his FragmentMapActivity was calling Window.hasFeature() which only exists on API level 11 or higher [3] (hence the "Could not find method android.view.Window.hasFeature").

I think the code in question no longer exists in his base 'experimental-fragment-activity-feature-impl-r6' branch [4], so maybe re-building from that branch will fix the issue.  It might be good to check in with Taro to see what the status of that branch is (i.e. if he thinks its ready for general use).

Good luck :)

Thanks,
Pete

Taro KOBAYASHI

unread,
Dec 26, 2011, 1:38:10 AM12/26/11
to Android Compatibility Library for Google Maps - Support
Hi Stratos,
Sorry for the late reply.

I searched my branches

experimental-fragment-activity-feature-impl-r4
experimental-fragment-activity-feature-impl-r6

with the query:

$ find . -type f -name "*.java" -exec grep -nH -e hasFeature {} NUL
";"

and there are no match.


I think some external code (maybe yours / aother library's) call the
method
Landroid/view/Window;.hasFeature (I)Z.

As Pete Dolye notes, (and Pete Doyle, thanks a lot for your quick
response!)
this method exists since api level 11.

Your project seems to be targeting api level higher than 11 with the
minSdkVersion somewhat lower than it,
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>

Generally speaking, this requires you special attention when targeting
lower api devices, since
calling new methods(, say, which come from api level 11) is completely
legal
at the compiling phase while it causes VFY on older platforms at
runtime.






On 12月23日, 午前9:13, Pete Doyle <petedo...@gmail.com> wrote:
> Hi Stratos,
> I'm pretty sure you're using Taro Kobayashi's fork [1] considering my
> original [2] doesn't have a FragmentMapActivity.  I'm not sure if he's
> listening here or not so you might have better luck submitting a Github
> issue on his fork or asking on him (@9re) on twitter.
>
> It looks like his FragmentMapActivity was calling Window.hasFeature() which
> only exists on API level 11 or higher [3] (hence the "Could not find method
> android.view.Window.hasFeature").
>
> I think the code in question no longer exists in his base
> 'experimental-fragment-activity-feature-impl-r6' branch [4], so maybe
> re-building from that branch will fix the issue.  It might be good to check
> in with Taro to see what the status of that branch is (i.e. if he thinks
> its ready for general use).
>
> Good luck :)
>
> Thanks,
> Pete
>
> [1]https://github.com/9re/android-support-v4-googlemaps
> [2]https://github.com/petedoyle/android-support-v4-googlemaps
> [3]http://developer.android.com/reference/android/view/Window.html#hasFe...)
> [4]https://github.com/9re/android-support-v4-googlemaps/blob/experimenta...

eeVoskos

unread,
Dec 27, 2011, 5:47:32 AM12/27/11
to Android Compatibility Library for Google Maps - Support
Hello again,

You are right, indeed: I was not using Pete Doyle's hack, but a
modified version contained in the ActionBarSherlock project. So, this
problem does not directly apply here. I will look into it though.
Thank you both for the quick replies and the detailed feedback.

However, I do have a complaint from a client in an app that uses one
of Pete Doyle's pre-compiled jar libraries (android-support-v4-r6-
googlemaps.jar). The problem is very similar: when an activity that
contains a map fragment starts, the screen goes black, only to appear
a few minutes later. Unfortunately I cannot reproduce this on the
emulator or on any of my development devices, and a logcat is not
available. I'll come back to this if I manage to reproduce the problem
and have a decent log or sth.

Thanks again for the feedback and thanks to Pete for this library,
when Google has deserted us!

Happy New Year,
Stratos
Reply all
Reply to author
Forward
0 new messages