ushahidi / Ushahidi_Android

[Deprecated] Ushahidi Android app For Ushahidi V2.x.x. Working on V3.x.x at
https://github.com/ushahidi/platform-android/
GNU Lesser General Public License v3.0
202 stars 153 forks source link

Main map does not load, but mini-maps in reports do #158

Closed andrewcarreiro closed 10 years ago

andrewcarreiro commented 10 years ago

In my whitelabeled app, maps load on an individual report's page, but not on the main "map" tab. The red bubble-pins exist on the main map, but there is no background.

My Google maps api key has been set up, and this issue was noted on a signed app.

My theme.xml file's Google maps api section looks like this, with "myapikey" being replaced by my real api key.

<!-- GOOGLE MAPS API -->
<!-- Dev Key -->
  <string name="google_map_api_key_dev">myapikey</string>
<!-- Live Key -->
  <string name="google_map_api_key">myapikey</string>

Any ideas on how this would happen?

eyedol commented 10 years ago

Funky. Did you use your app's package name to generate the apikey?

andrewcarreiro commented 10 years ago

Yes, and it works in the individual report page, which is why I assumed it wasn't an API issue. On 23 Jul 2013 22:50, "Henry Addo" notifications@github.com wrote:

Funky. Did you use the your app's package name to generate the apikey?

— Reply to this email directly or view it on GitHubhttps://github.com/ushahidi/Ushahidi_Android/issues/158#issuecomment-21460551 .

eyedol commented 10 years ago

Hmm. Anything interesting from the logs?

Also, what happens if you hard code the api key in your themed manifest file. See here

eyedol commented 10 years ago

@andrewcarreiro I can reproduce this from my end. I will double check tonight. Let me know how it goes with the hard coded API in the manifest file

andrewcarreiro commented 10 years ago

Hard coded API doesn't seem to fix it; I've attached the only red in the logs below: 07-26 13:53:35.295: E/com.ushahidi.android.app.util.Objects(16253): InstantiationException 07-26 13:53:35.295: E/com.ushahidi.android.app.util.Objects(16253): java.lang.InstantiationException: can't instantiate class com.ushahidi.android.app.views.View 07-26 13:53:35.295: E/com.ushahidi.android.app.util.Objects(16253): at java.lang.reflect.Constructor.constructNative(Native Method) 07-26 13:53:35.295: E/com.ushahidi.android.app.util.Objects(16253): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) 07-26 13:53:35.295: E/com.ushahidi.android.app.util.Objects(16253): at com.ushahidi.android.app.util.Objects.createInstance(Objects.java:73) 07-26 13:53:35.295: E/com.ushahidi.android.app.util.Objects(16253): at com.ushahidi.android.app.activities.BaseActivity.onCreate(BaseActivity.java:149) 07-26 13:53:35.295: E/com.ushahidi.android.app.util.Objects(16253): at com.ushahidi.android.app.ui.phone.ReportTabActivity.onCreate(ReportTabActivity.java:34) 07-26 13:53:35.295: E/com.ushahidi.android.app.util.Objects(16253): at android.app.Activity.performCreate(Activity.java:5104) 07-26 13:53:35.295: E/com.ushahidi.android.app.util.Objects(16253): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080) 07-26 13:53:35.295: E/com.ushahidi.android.app.util.Objects(16253): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144) 07-26 13:53:35.295: E/com.ushahidi.android.app.util.Objects(16253): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) 07-26 13:53:35.295: E/com.ushahidi.android.app.util.Objects(16253): at android.app.ActivityThread.access$600(ActivityThread.java:141) 07-26 13:53:35.295: E/com.ushahidi.android.app.util.Objects(16253): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) 07-26 13:53:35.295: E/com.ushahidi.android.app.util.Objects(16253): at android.os.Handler.dispatchMessage(Handler.java:99) 07-26 13:53:35.295: E/com.ushahidi.android.app.util.Objects(16253): at android.os.Looper.loop(Looper.java:137) 07-26 13:53:35.295: E/com.ushahidi.android.app.util.Objects(16253): at android.app.ActivityThread.main(ActivityThread.java:5041) 07-26 13:53:35.295: E/com.ushahidi.android.app.util.Objects(16253): at java.lang.reflect.Method.invokeNative(Native Method) 07-26 13:53:35.295: E/com.ushahidi.android.app.util.Objects(16253): at java.lang.reflect.Method.invoke(Method.java:511) 07-26 13:53:35.295: E/com.ushahidi.android.app.util.Objects(16253): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 07-26 13:53:35.295: E/com.ushahidi.android.app.util.Objects(16253): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 07-26 13:53:35.295: E/com.ushahidi.android.app.util.Objects(16253): at dalvik.system.NativeStart.main(Native Method)

andrewcarreiro commented 10 years ago

I'm not sure if this is related, but changing categories in the full map view don't seem to limit the pins shown, either.

eyedol commented 10 years ago

@andrewcarreiro That should be a bug. Fixed filtering by category.

The map api key issue, I still can't figure out what's causing it. Did you change the package name for these entries in your manifest file?

<permission
        android:name="com.ushahidi.android.app.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

<uses-permission android:name="com.ushahidi.android.app.permission.MAPS_RECEIVE" />
reddy2401 commented 10 years ago

The issue with map tile. comment the following code in MapFragment.java at 112 line in initMap() method. Util.setMapTile(getActivity(), map); Then map displays without tiles.

shakhal commented 10 years ago

Thank you @reddy2401, solved our problem too, great timing!

aomegax commented 10 years ago

Hi, I have the same problem with map in "Add Report". Any ideas about?

joeyvanderbie commented 10 years ago

For me it turned out to be a debug problem over Wifi as stated here: http://stackoverflow.com/a/17527910

Fixed by adding in the manifest