首页 / 浏览问题 / 移动GIS / 问题详情
ARmeasure测量报错
4EXP 2022年10月17日
使用产品:iMobile 11i 操作系统:win10 x64

2022-10-17 22:40:25.513 14717-14717/com.example.myapplication E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.myapplication, PID: 14717
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapplication/com.example.myapplication.AImeasure}: android.view.InflateException: Binary XML file line #11 in com.example.myapplication:layout/activity_aimeasure: Binary XML file line #11 in com.example.myapplication:layout/activity_aimeasure: Error inflating class com.supermap.ar.highprecision.ARMeasureView
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3680)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3835)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2291)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:230)
        at android.app.ActivityThread.main(ActivityThread.java:8024)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:526)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1034)
     Caused by: android.view.InflateException: Binary XML file line #11 in com.example.myapplication:layout/activity_aimeasure: Binary XML file line #11 in com.example.myapplication:layout/activity_aimeasure: Error inflating class com.supermap.ar.highprecision.ARMeasureView
     Caused by: android.view.InflateException: Binary XML file line #11 in com.example.myapplication:layout/activity_aimeasure: Error inflating class com.supermap.ar.highprecision.ARMeasureView
     Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Constructor.newInstance0(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
        at android.view.LayoutInflater.createView(LayoutInflater.java:871)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1063)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1014)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1193)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1154)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:696)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:548)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:699)
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:195)
        at com.example.myapplication.AImeasure.onCreate(AImeasure.java:107)
        at android.app.Activity.performCreate(Activity.java:7894)
        at android.app.Activity.performCreate(Activity.java:7883)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1353)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3655)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3835)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2291)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:230)
        at android.app.ActivityThread.main(ActivityThread.java:8024)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:526)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1034)
     Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/ar/core/PointCloud;
2022-10-17 22:40:25.514 14717-14717/com.example.myapplication E/AndroidRuntime:     at com.supermap.ar.highprecision.PointCloudRenderer.<clinit>(PointCloudRenderer.java:15)
        at com.supermap.ar.highprecision.ARMeasureView.<init>(ARMeasureView.java:81)
            ... 28 more
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.ar.core.PointCloud" on path: DexPathList[[zip file "/data/app/com.example.myapplication-DrqwMmRevhje5vlB5ZcOWw==/base.apk", zip file "/system/framework/org.apache.http.legacy.jar"],nativeLibraryDirectories=[/data/app/com.example.myapplication-DrqwMmRevhje5vlB5ZcOWw==/lib/arm, /data/app/com.example.myapplication-DrqwMmRevhje5vlB5ZcOWw==/base.apk!/lib/armeabi-v7a, /system/lib, /system/product/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
            ... 30 more

1个回答

您好,请问您那边使用的是什么测试机呢,如果是华为,还需要支持AR,如果您不确定是否支持AR,可以使用去应用市场下载iTablet在里面使用AR功能看看是否支持AR,确认支持AR之后,根据报错信息来看,提示找不到加载类,您可以把sdk包中所有依赖都添加进去,看看是否还会报错
3,690EXP 2022年10月18日
是vivo X27,在添加了相关依赖之后,这些报错都没有了,但是没有摄像头的画面,是灰色的
您那边看看有没有获取到相机使用许可呢
在AndroidManifest.xml中添加了相机权限,然后也有动态权限获取的操作,Logcat有一个错误是Get VideoList Failed,不知道是不是这个的问题。
您可以参考这个demo,可以正常运行的

链接:https://pan.baidu.com/s/1ErDDteK845v9ko6btvBbqQ?pwd=jjbu
提取码:jjbu
打开工程后查看3dar模块
...