2016-08-04 3 views
1

Ich erhalte diesen Fehler, wenn ich versuche, eine MapBox-Ansicht in meine App zu laden. Bin ich im Code falsch gelaufen?MapBox: Shader konnte nicht kompiliert werden: FEHLER: Gültige GLSL aber nicht GLSL ES

Test-Info:

Nexus 5X (API 23) Android 6.0 x86_64 emulator, Android Studio 2.2 Preview 7 (Mac)

Gradle:

compile('com.mapbox.mapboxsdk:mapbox-android-sdk:[email protected]') { 
    transitive = true 
} 

MapActivity:

@Override 
protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 

    setContentView(R.layout.activity_map); 

    MapboxAccountManager.start(this, getString(R.string.accessToken)); 

    // Create a mapView 
    mapView = (MapView) findViewById(R.id.mapview); 
    // Doesn't work without using deprecated setAccessToken... bug?? 
    mapView.setAccessToken(getString(R.string.accessToken)); 

    mapView.getMapAsync(new OnMapReadyCallback() { 
     @Override 
     public void onMapReady(MapboxMap mapboxMap) { 

     } 
    }); 
    mapView.onCreate(savedInstanceState); 
} 

XML:

<com.mapbox.mapboxsdk.maps.MapView 
    android:id="@+id/mapview" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    mapbox:style_url="@string/style_mapbox_streets" 
    mapbox:center_latitude="41.885" 
    mapbox:center_longitude="-87.679" 
    mapbox:zoom="12" 
    mapbox:tilt="20" /> 

Protokolle:

E/mbgl: [Shader]: Shader failed to compile: ERROR: Valid GLSL but not GLSL ES 
E/mbgl: [Shader]: Vertex shader fill failed to compile: precision highp float; 
     #ifdef GL_ES 
     precision highp float; 
     #else 
     #define lowp 
     #define mediump 
     #define highp 
     #endif 

     attribute vec2 a_pos; 

     uniform mat4 u_matrix; 

     void main() { 
       gl_Position = u_matrix * vec4(a_pos, 0, 1); 
     } 
A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0xdeadcab1 in tid 22621 
+0

Duplizieren von http://stackoverflow.com/questions/38538157/mapbox-android-application-crashes-after-update-to-sdk-4-1-0-on-emulator/ – RobLabs

+0

Auch, bitte bearbeiten Sie Ihre Tests Informationen (z. B. Gerät gegen Emulator, Arm gegen x86). – RobLabs

+0

@RobLabs Mit Info aktualisiert – doovers

Antwort

1

Welche Version von Android Studio verwenden Sie und werden Sie Ihre Anwendung auf einem Emulator oder physisches Gerät laufen? getestet und war in der Lage, mit der Beta-Version von Studio, aber nicht den Stall zu produzieren.

Eine Randbemerkung:

MapboxAccountManager.start(this, getString(R.string.accessToken)); 

muss, bevor setContentView() gehen, wenn Sie Ihre mapview im XML haben.

+0

Aktualisierte Frage mit angeforderten Informationen – doovers