Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Loading Maps on Android TV #13096

Closed
bundeeteddee opened this issue Oct 14, 2018 · 2 comments
Closed

Loading Maps on Android TV #13096

bundeeteddee opened this issue Oct 14, 2018 · 2 comments
Labels
Android Mapbox Maps SDK for Android

Comments

@bundeeteddee
Copy link

I am trying to try prototype an android TV application with MapBox but i keep getting this:

    java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.os.BaseBundle.getBoolean(java.lang.String, boolean)' on a null object reference
        at com.mapbox.mapboxsdk.storage.FileSource.getCachePath(FileSource.java:88)
        at com.mapbox.mapboxsdk.storage.FileSource$FileDirsPathsTask.doInBackground(FileSource.java:165)
        at com.mapbox.mapboxsdk.storage.FileSource$FileDirsPathsTask.doInBackground(FileSource.java:155)
        at android.os.AsyncTask$2.call(AsyncTask.java:304)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
2018-10-14 05:06:24.463 32506-32506/com.tv I/art: Thread[1,tid=32506,Native,Thread*=0xa8105400,peer=0x73f84680,"main"] recursive attempt to load library "/data/app/com.tv-1/lib/arm/libmapbox-gl.so"
2018-10-14 05:06:24.472 32506-32506/com.tv I/art: Thread[1,tid=32506,Native,Thread*=0xa8105400,peer=0x73f84680,"main"] recursive attempt to load library "/data/app/com.tv-1/lib/arm/libmapbox-gl.so"
2018-10-14 05:06:24.473 32506-32506/com.tv I/art: Thread[1,tid=32506,Native,Thread*=0xa8105400,peer=0x73f84680,"main"] recursive attempt to load library "/data/app/com.tv-1/lib/arm/libmapbox-gl.so"

Application doesn't crash but maps don't load.

I would like to know more about:

  1. if Mapbox should work on android tvs
  2. If there are special steps to generate libraries (different architecture) just for tv?
  3. Permissions requirements.

Steps to reproduce

  1. Almost identical code using activity + fragment in the examples (Relativelayout and Mapview inside), calling Mapbox.getInstance(...), and setting it up as usual.
  2. Setup debug environment on an android tv
  3. Deploy

Expected behavior

Able to get the Mapbox instance object, and map with default zoom and location is shown on tv.

Actual behavior

onStart lifecycle gets called but with a NPE while trying to get cache path. TV showing blank.

Configuration

Android versions:
Android 7.0, api 24

Device models:
Sony Bravia 4k 2015

Mapbox SDK versions:
I've tried 6.5 and 6.6.

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Oct 15, 2018
@tobrun
Copy link
Member

tobrun commented Oct 15, 2018

Thank you for reaching out @bundeeteddee.

I would like to know more about:
if Mapbox should work on android tvs
If there are special steps to generate libraries (different architecture) just for tv?
Permissions requirements.

There aren't any additional requirements to get our map running on Android TV.

Application doesn't crash but maps don't load.

The exception is caught in FileSource#getCachePath() and should result in not trying to use external storage but rather the internal storage. This is a valid execution path and shouldn't impact running the SDK on Android TV. I will fix this occurrence up but the business logic will remain intact.

TV showing blank.

Some follow up questions to get to the bottom of this:

  • Are you seeing the mapbox logo and attribution icon on the bottom left but the map is not rendering?
  • Can you debug/log and verify if the OnMapReady callback is invoked?

@bundeeteddee
Copy link
Author

@tobrun Thanks for getting back to me this quick.

When you mentioned attribution, it made me think about if i made some error on layout itself (i was changing up between view groups while trying to get it to work).

And fair enough, i made a stupid mistake. Sorry for wasting your time on this. I am all good now!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

No branches or pull requests

2 participants