Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.Throwable: EventHub.removeMessages(int what = 107) is not supported before the WebViewCore is set up. #83

Open
Piero87 opened this issue Mar 4, 2016 · 4 comments

Comments

@Piero87
Copy link

Piero87 commented Mar 4, 2016

Hi,
i have tried to create a sample with this code:

import com.airbnb.android.airmapview.AirMapMarker;
import com.airbnb.android.airmapview.AirMapPolyline;
import com.airbnb.android.airmapview.AirMapView;
import com.airbnb.android.airmapview.DefaultAirMapViewBuilder;
import com.airbnb.android.airmapview.listeners.OnMapInitializedListener;
import com.google.android.gms.maps.model.LatLng;

import java.util.Arrays;

public class SelectMapAreaGame extends AppCompatActivity implements OnMapInitializedListener {

    private AirMapView map;
    private DefaultAirMapViewBuilder mapViewBuilder;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_select_map_area_game);

        mapViewBuilder = new DefaultAirMapViewBuilder(this);
        map = (AirMapView) findViewById(R.id.map_view);

        map.setOnMapInitializedListener(this);
        map.initialize(getSupportFragmentManager());

    }

    private void addMarker(String title, LatLng latLng, int id) {
        map.addMarker(new AirMapMarker.Builder()
                .id(id)
                .position(latLng)
                .title(title)
                .iconId(R.drawable.ghost)
                .build());
    }

    @Override public void onMapInitialized() {
        System.out.println("Map onMapInitialized triggered");
        final LatLng airbnbLatLng = new LatLng(37.771883, -122.405224);
        addMarker("Airbnb HQ", airbnbLatLng, 1);
        addMarker("Performance Bikes", new LatLng(37.773975, -122.40205), 2);
        addMarker("REI", new LatLng(37.772127, -122.404411), 3);
        addMarker("Mapbox", new LatLng(37.77572, -122.41354), 4);
        map.animateCenterZoom(airbnbLatLng, 10);

        // Add Polylines
        LatLng[] latLngs = {
                new LatLng(37.77977, -122.38937),
                new LatLng(37.77811, -122.39160),
                new LatLng(37.77787, -122.38864)};

        map.addPolyline(new AirMapPolyline(Arrays.asList(latLngs), 5));


        // Add Circle
        map.drawCircle(new LatLng(37.78443, -122.40805), 1000);

        // enable my location
        map.setMyLocationEnabled(true);
    }
}

and i have a blank view with this in the console:

W/webcore: java.lang.Throwable: EventHub.removeMessages(int what = 107) is not supported before the WebViewCore is set up.
                                                                          at android.webkit.WebViewCore$EventHub.removeMessages(WebViewCore.java:1684)
                                                                          at android.webkit.WebViewCore$EventHub.access$7900(WebViewCore.java:927)
                                                                          at android.webkit.WebViewCore.removeMessages(WebViewCore.java:1796)
                                                                          at android.webkit.WebView.sendOurVisibleRect(WebView.java:2953)
                                                                          at android.webkit.ZoomManager.setZoomScale(ZoomManager.java:593)
                                                                          at android.webkit.ZoomManager.access$1700(ZoomManager.java:49)
                                                                          at android.webkit.ZoomManager$PostScale.run(ZoomManager.java:984)
                                                                          at android.os.Handler.handleCallback(Handler.java:605)
                                                                          at android.os.Handler.dispatchMessage(Handler.java:92)
                                                                          at android.os.Looper.loop(Looper.java:137)
                                                                          at android.app.ActivityThread.main(ActivityThread.java:4424)
                                                                          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:784)
                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
                                                                          at dalvik.system.NativeStart.main(Native Method)

how i can fix?

@felipecsl
Copy link
Contributor

That exception is coming from the webcore process, not your process.
What device model and Android version are you running on?

@Piero87
Copy link
Author

Piero87 commented Mar 4, 2016

I am using an Android emulator api level 15.

Il giorno 05 mar 2016, alle ore 00:08, Felipe Lima notifications@github.com ha scritto:

That exception is coming from the webcore process, not your process.
What device model and Android version are you running on?


Reply to this email directly or view it on GitHub.

@felipecsl
Copy link
Contributor

I don't have a device with API 15 available for testing, but I tried on one with API 16 and it worked fine. Can you try on a different device to see if the problem persists?

@Piero87
Copy link
Author

Piero87 commented Mar 5, 2016

At the momento i can try only on the emulator, and my target is for a device with API Level 15

Il giorno 05 mar 2016, alle ore 00:39, Felipe Lima notifications@github.com ha scritto:

I don't have a device with API 15 available for testing, but I tried on one with API 16 and it worked fine. Can you try on a different device to see if the problem persists?


Reply to this email directly or view it on GitHub #83 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants