错误二进制XML文件行#7:膨胀类com.esri.android.map.MapView时出错
我为Android设置了ArcGIS运行时SDK,但运行show error 二进制XML文件行#7:膨胀类com.esri.android.map.MapView时出错 原因:java.lang.UnsatifiedLinkError:找不到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_map_Surface_NativeMap_创建_Ljava_lang_String_2IIFZ) 还有我的密码错误二进制XML文件行#7:膨胀类com.esri.android.map.MapView时出错,android,dictionary,arcgis,Android,Dictionary,Arcgis,我为Android设置了ArcGIS运行时SDK,但运行show error 二进制XML文件行#7:膨胀类com.esri.android.map.MapView时出错 原因:java.lang.UnsatifiedLinkError:找不到long com.esri.android.map.MapSurface.nativeMapCreate(java.lang.String、int、int、float、boolean)的实现(已尝试java_com_esri_android_map_Map
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'
}
}
还有我的碎片
@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;
}
看起来您正在使用版本中的代码,但正在gradle脚本中导入版本。API在这些版本之间发生了更改 还有一种可能得到此异常。如果您没有在android下的应用程序级别
build.gradle
文件中添加这些行。如上所述
这里我的导入编译'com.esri.arcgisruntime:arcgis android:100.1.0',但无法正常工作,但代码段中的代码属于10.2.x版本。要使用该代码,您需要使用compile'com.esri.arcgis.android:arcgis android:10.2.9',如果您要使用100.1.0版本,API已更改,并且您在其中的代码不再有效。请在此处包含您的XML。
android {
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}