【发布时间】:2019-01-28 22:10:59
【问题描述】:
您好,我尝试使用 Map Box 和 Android Studio 来学习如何构建 GIS 应用程序。我按照本教程进行操作,https://www.mapbox.com/install/android/ 但是当我尝试测试安装或一些示例时,我收到以下错误。
Android 资源编译失败输出: C:\Users\Vassilis\AndroidStudioProjects\mapBox_test_nbg\app\src\main\res\layout\activity_main.xml:3: 错误:重复属性。
命令: C:\Users\Vassilis.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\efd9526a9f78532313c282340621c36b\aapt2-3.2.1-4818971-windows\aapt2.exe 编译 --legacy \ -o \ C:\Users\Vassilis\AndroidStudioProjects\mapBox_test_nbg\app\build\intermediates\res\merged\debug \ C:\Users\Vassilis\AndroidStudioProjects\mapBox_test_nbg\app\src\main\res\layout\activity_main.xml 守护进程:AAPT2 aapt2-3.2.1-4818971-windows 守护进程#2
activity_main.xml的代码是:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:mapbox="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<com.mapbox.mapboxsdk.maps.MapView
android:id="@+id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
mapbox:mapbox_cameraTargetLat="40.73581"
mapbox:mapbox_cameraTargetLng="-73.99155"
mapbox:mapbox_cameraZoom="11"
mapbox:mapbox_styleUrl="mapbox://styles/mapbox/streets-v11"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
【问题讨论】: