Android 布局编辑器使用MapBox渲染错误

Android 布局编辑器使用MapBox渲染错误,android,android-layout,android-studio,mapbox,Android,Android Layout,Android Studio,Mapbox,尝试在Android Studio中使用布局编辑器时出现以下错误: Rendering Problems The following classes could not be instantiated: - com.mapbox.mapboxsdk.maps.widgets.MyLocationView 代码工作正常,显示了地图。这是布局编辑器的一个问题 Github上的SSCCE: 但是请注意,为了运行代码,您需要在access\u token中提供映射框访问令牌 activity_main

尝试在Android Studio中使用布局编辑器时出现以下错误:

Rendering Problems The following classes could not be instantiated:
- com.mapbox.mapboxsdk.maps.widgets.MyLocationView
代码工作正常,显示了地图。这是布局编辑器的一个问题

Github上的SSCCE: 但是请注意,为了运行代码,您需要在access\u token中提供映射框访问令牌

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:mapbox="http://schemas.android.com/apk/res-auto"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="testdemo.com.layouteditorrenderproblem.MainActivity">

    <!-- NYC Union Square: 40.73581, -73.99155 -->
    <com.mapbox.mapboxsdk.maps.MapView
        android:id="@+id/mapView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        mapbox:center_latitude="40.73581"
        mapbox:center_longitude="-73.99155"
        mapbox:style_url="mapbox://styles/mapbox/streets-v9"
        mapbox:zoom="17" />

</RelativeLayout>
改为:

compile('com.mapbox.mapboxsdk:mapbox-android-sdk:4.2.1@aar')
compile('com.mapbox.mapboxsdk:mapbox-android-sdk:5.0.0-beta.1@aar')
仍然得到错误

然后改为:

compile('com.mapbox.mapboxsdk:mapbox-android-sdk:4.2.1@aar')
compile('com.mapbox.mapboxsdk:mapbox-android-sdk:5.0.0-beta.1@aar')
我会遇到如下错误:

找不到与textColor处的给定名称匹配的资源 值@color/black`


您的项目似乎正在使用我们的SDK的过时版本。这个问题应该在最新的稳定版和测试版中解决。请升级到4.2.1或5.0.0-beta.1,看看这是否解决了问题。

感谢您的回复。我根据你的答案添加了信息。出于某种原因,今天它起作用了。也就是说,对于4.1.1,我得到了错误,对于4.2.2。我不。