是不能写在fragment中,在加载有 MapView的布局时 报错。
fragment layout布局:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.supermap.mapping.MapView
android:id="@+id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent">
</com.supermap.mapping.MapView>
</RelativeLayout>
错误信息:
Process: com.runto.sport, PID: 20643
android.view.InflateException: Binary XML file line #12: Binary XML file line #12: Error inflating class com.supermap.mapping.MapView
Caused by: android.view.InflateException: Binary XML file line #12: Error inflating class com.supermap.mapping.MapView
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
at android.view.LayoutInflater.createView(LayoutInflater.java:656)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:798)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:738)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:869)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:832)
at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
at android.databinding.DataBindingUtil.inflate(DataBindingUtil.java:126)
at android.databinding.DataBindingUtil.inflate(DataBindingUtil.java:95)
at com.runto.sport.fragment.MotionFragment.initBinding(MotionFragment.java:33)
at com.runto.sport.base.BaseFragment.onCreateView(BaseFragment.java:22)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:2439)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1460)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:802)
at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2625)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411)
at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)
at android.support.v4.app.FragmentManagerImpl.execSingleAction(FragmentManager.java:2243)
at android.support.v4.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:654)
at android.support.v4.app.FragmentStatePagerAdapter.finishUpdate(FragmentStatePagerAdapter.java:168)
at android.support.v4.view.ViewPager.populate(ViewPager.java:1244)
at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:669)
at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:631)
at android.support.v4.view.ViewPager.setCurrentItem(ViewPager.java:612)
at com.runto.sport.activity.MainActivity.onCheckedChanged(MainActivity.java:104)
at android.widget.RadioGroup.setCheckedId(RadioGroup.java:173)
at android.widget.RadioGroup.-wrap0(RadioGroup.java)
at android.widget.RadioGroup$CheckedStateTracker.onCheckedChanged(RadioGroup.java:351)
at android.widget.CompoundButton.setChecked(CompoundButton.java:160)
at android.widget.CompoundButton.toggle(CompoundButton.java:116)
at android.widget.RadioButton.toggle(RadioButton.java:76)
at android.widget.CompoundButton.performClick(CompoundButton.java:121)
at android.view.View$PerformClick.run(View.java:22627)
at android.os.Handler.handleCallback(Handler.java:846)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:205)
at android.app.ActivityThread.main(ActivityThread.java:6753)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1216)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1077)
Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.runto.sport-2/base.apk"],nativeLibraryDirectories=[/data/app/com.runto.sport-2/lib/arm, /data/app/com.runto.sport-2/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib, /system/vendor/lib, /product/lib]]] couldn't find "libimb.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:989)
at java.lang.System.loadLibrary(System.java:1533)
at com.supermap.data.Environment.LoadWrapJ(Environment.java:455)
at com.supermap.data.Environment.InternalLoadWrapJ(Environment.java:1093)
at com.supermap.mapping.g.a(InternalEnvironment.java:22)
at com.supermap.mapping.MapControl2.<clinit>(MapControl2.java:45)
at com.supermap.mapping.MapControl.a(MapControl.java:62)
at com.supermap.mapping.MapControl.<init>(MapControl.java:33)
at com.supermap.mapping.MapView.a(MapView.java:91)
at com.supermap.mapping.MapView.<init>(MapView.java:82)