でエラーをレンダリング:レイアウトエディタは、Android Studioでレイアウトエディタを使用しようとしたとき、私は次のエラーを取得するMapBox
Rendering Problems The following classes could not be instantiated:
- com.mapbox.mapboxsdk.maps.widgets.MyLocationView
コードが正常に動作し、地図が表示されます。これは厳密にレイアウトエディタの問題です。 Githubの上
SSCCE:
https://github.com/emnrd-ito/LayoutEditorRenderProblem
(コードを実行するために、あなたはaccess_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>
編集: @cammaceの回答に基づくさらに詳しい情報:
オリジナルの依存関係:に変更
compile('com.mapbox.mapboxsdk:mapbox-android-sdk:[email protected]') {
transitive = true
}
compile('com.mapbox.mapboxsdk:mapbox-android-services:[email protected]') {
transitive = true
}
:
compile('com.mapbox.mapboxsdk:mapbox-android-sdk:[email protected]')
それでもエラーが発生します。私のようなエラーが出
compile('com.mapbox.mapboxsdk:mapbox-android-sdk:[email protected]')
:
ないリソースはそれが( 値@カラー/ black`で
はその後に変更しました。textColor
で)指定された名前と一致してい
<TextView
android:text="@string/app_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/about_app_name"
android:textStyle="bold"
android:textColor="@color/black"
android:textSize="@dimen/text_size_xxl"/>
ご回答ありがとうございます。私はあなたの答えに基づいて情報を追加しました。 –
何らかの理由で、今日は動作します。つまり、4.1.1では4.2.2でエラーが発生します。私はしません。 –