android - 错误二进制 XML 文件行 #7 : Error inflating class com. esri.android.map.MapView

标签 android dictionary arcgis

我设置了 ArcGIS Runtime SDK for Android 但运行时显示错误 二进制 XML 文件第 7 行:扩展类 com.esri.android.map.MapView 时出错 由以下原因引起:java.lang.UnsatisfiedLinkError:未找到 long com.esri.android.map.MapSurface.nativeMapCreate(java.lang.String, int, int, float, boolean) 的实现(尝试了 Java_com_esri_android_map_MapSurface_nativeMapCreate 和 Java_com_esri_android_map_MapSurface_nativeMapCreate__Ljava_lang_String_2IIFZ )

还有我的代码

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'org.slf4j:slf4j-api:1.7.25'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'pl.bclogic:pulsator4droid:1.0.3'
compile 'com.esri.arcgisruntime:arcgis-android:100.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.makeramen:roundedimageview:2.3.0'
testCompile 'junit:junit:4.12'

}
repositories {
    mavenCentral()
}
android {
    packagingOptions {
        exclude 'META-INF/LGPL2.1'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
}

还有我的 fragment

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View view = inflater.inflate(R.layout.fragment_map, container, false);
    mMapView = (MapView) view.findViewById(R.id.map);
    try {
        shapefileTable = new ShapefileFeatureTable("file:///android_asset/yourPath/vietnam.shp");
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    }
    FeatureLayer featureLayer = new FeatureLayer(shapefileTable);

    UniqueValueRenderer uvRenderer = new UniqueValueRenderer();
    uvRenderer.setDefaultSymbol(new SimpleFillSymbol(R.color.colorPrimary, null));
    // set renderer
    featureLayer.setRenderer(uvRenderer);
    mMapView.addLayer(featureLayer);
    return view;
}

最佳答案

看起来您正在使用 10.2.x 中的代码发布但正在导入 100.1.0在你的 gradle 脚本中发布。 API 在这些版本之间发生了变化。

关于android - 错误二进制 XML 文件行 #7 : Error inflating class com. esri.android.map.MapView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46305534/

相关文章:

javascript 代码在插入 html 地理定位 map 时不起作用

javascript - 动态加载ArcGIS在线模块

gis - 使用 ArcGIS API for JavaScript 在 3D 中堆叠拉伸(stretch)多边形

android - 更改android自定义帐户的用户名和密码

java.lang.NoSuchMethodError : No static method - Firebase issue despite not using FirebaseMessagingService?

arrays - 使用 slice []reflect.Type 作为映射键

ios - 使用 RestSharp 的 ArcGis 连接错误

java - 使用 MYSQL 插入数据但没有任何反应

android - 混淆器.ParseException : Expecting class member name before '@' in Android Eclipse ADT

c# - 如何创建一个字典列表作为另一个字典的值?