首页 / 浏览问题 / 移动GIS / 问题详情
iMmobile AR测量demo 报错
8EXP 2022年03月26日

大伙好,

我的环境:

使用产品:supermap-imobile-10.2.1-228-android-zip-chs  

demo :AndroidStudioSampleCode/ARCartograph

10i 操作系统:mac 10.15.15

Android studio :2022.03.01 北极狐

gradle 版本:5.6.4 

gradle Android  plugin 版本:  'com.android.tools.build:gradle:3.6.0'

导入的 so 库 和 jar 包 :来源下载的 lib 目录下 

测试机:vivo IQOO ,Android 11 

问题描述:

我把ARCartographView demo 跑起来,然后就出现一下报错:

2022-03-26 11:39:38.058 7640-7819/com.supermap.imobile.myapplication E/AndroidRuntime: FATAL EXCEPTION: GLThread 1679
    Process: com.supermap.imobile.myapplication, PID: 7640
    java.lang.UnsatisfiedLinkError: No implementation found for long com.google.ar.core.Session.nativeGetSymbolTable(long) (tried Java_com_google_ar_core_Session_nativeGetSymbolTable and Java_com_google_ar_core_Session_nativeGetSymbolTable__J)
        at com.google.ar.core.Session.nativeGetSymbolTable(Native Method)
        at com.google.ar.core.Session.<init>(Session.java:12)
        at com.google.ar.core.Session.<init>(Session.java:4)
        at com.supermap.ar.arcartograph.l.a(SessionHelper.java:32)
        at com.supermap.ar.arcartograph.l.a(SessionHelper.java:64)
        at com.supermap.ar.arcartograph.ARCartographView$1.onSurfaceCreated(ARCartographView.java:191)
        at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1541)
        at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1272)

还有这边是我的导入库:

B8A8366A-ED54-411C-ADC8-C76A727FFABD.png

以及gradle 引入的ARCore:

api 'com.google.ar:core:1.25.0'
api 'com.google.android.filament:filament-android:1.7.0'
api 'com.google.android.filament:gltfio-android:1.7.0'
api 'com.google.android.filament:filament-utils-android:1.9.25'

这是我的测量Activitiy:

package com.supermap.imobile.myapplication;


import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;

import com.supermap.ar.arcartograph.ARCartographView;
import com.supermap.ar.arcartograph.ARRulerCallBack;
//ARActivity
public class ArMeasureActivity extends AppCompatActivity implements View.OnClickListener, ARRulerCallBack, ARCartographView.SceneDepthListener {
    private ARCartographView mARCartographView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ar_measure);
        mARCartographView = findViewById(R.id.gl_ruler_show);
    }

    @Override
    public void onClick(View v) {

    }

    @Override
    public void SceneDepthCallBack(float seneDepth) {
        Log.e("length","Scene Depth: " + String.format("%.5f", seneDepth));

    }

    @Override
    public void showPrompt(boolean b) {

    }

    @Override
    public void showPrompt(boolean b, String s) {

    }
}

麻烦问下,我哪个环节缺漏了?还望多多指教~

1个回答

图裂了,补一下我导入的库:

8EXP 2022年03月26日

您好,您那边检查在在AndroidManifest.xml能力文档中是否有

<meta-data
    android:name="com.google.ar.core"
    android:value="required" />

将这个引用放在这个xml的application节点下

您好,你说的标签我也加到 AndroidManifest.xm 清单上了:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.supermap.imobile.myapplication">
    <!-- 添加权限 -->
    <uses-permission android:name="android.permission.VIBRATE" />

    <uses-feature android:name="android.hardware.camera.any" />
    <uses-feature
        android:name="android.hardware.camera"
        android:required="true" />
    <uses-feature
        android:name="android.hardware.camera.autofocus"
        android:required="true" />
    <uses-feature android:glEsVersion="0x00010100" />

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

<!--    tools:replace="android:appComponentFactory"-->
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/user"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:ignore="GoogleAppIndexingWarning">
        <activity
            android:name=".ArMeasureActivity"
            android:exported="true" />
        <activity
            android:name=".MainActivity"
            android:configChanges="screenSize|keyboardHidden|orientation"
            android:label="@string/title_activity_main"
            android:launchMode="singleInstance"
            android:theme="@style/AppTheme.NoActionBar" />
        <activity
            android:name=".POIMapActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Holo.Light.DarkActionBar"></activity>
        <activity
            android:name=".ARProjectionActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Holo.Light.DarkActionBar"></activity>
        <activity
            android:name=".HDMapActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Holo.Light.DarkActionBar"></activity> <!-- <activity -->
        <!-- android:name= ".AllFeatureActivity" -->
        <!-- android:label="@string/app_name" -->
        <!-- android:launchMode="singleInstance" -->
        <!-- android:theme="@android:style/Theme.Holo.Light.DarkActionBar" -->
        <!-- android:configChanges="keyboardHidden|orientation|screenSize" -->
        <!-- &gt; -->
        <!-- </activity> -->
        <activity
            android:name=".ARMapGestureOperateActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="@string/app_name"
            android:launchMode="singleInstance"
            android:theme="@android:style/Theme.Holo.Light.DarkActionBar"></activity>
        <activity
            android:name=".ARSimple"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Holo.Light.DarkActionBar"></activity>
        <activity
            android:name=".LoginActivity"
            android:configChanges="screenSize|keyboardHidden|orientation"
            android:label="@string/title_activity_login">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <meta-data
            android:name="com.google.ar.core"
            android:value="required" />
    </application>

</manifest>

但是结果还是那样:

2022-03-28 11:41:30.057 4608-5161/com.supermap.imobile.myapplication E/AndroidRuntime: FATAL EXCEPTION: GLThread 2893
    Process: com.supermap.imobile.myapplication, PID: 4608
    java.lang.UnsatisfiedLinkError: No implementation found for long com.google.ar.core.Session.nativeGetSymbolTable(long) (tried Java_com_google_ar_core_Session_nativeGetSymbolTable and Java_com_google_ar_core_Session_nativeGetSymbolTable__J)
        at com.google.ar.core.Session.nativeGetSymbolTable(Native Method)
        at com.google.ar.core.Session.<init>(Session.java:12)
        at com.google.ar.core.Session.<init>(Session.java:4)
        at com.supermap.ar.arcartograph.l.a(SessionHelper.java:32)
        at com.supermap.ar.arcartograph.l.a(SessionHelper.java:64)
        at com.supermap.ar.arcartograph.ARCartographView$1.onSurfaceCreated(ARCartographView.java:191)
        at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1541)
        at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1272)

补充下我的gradle.build 依赖:

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-vector-drawable:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
//    implementation 'androidx.appcompat:appcompat:1.2.0'
//    implementation 'com.google.android.material:material:1.3.0'
//    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    // For developers using the Android Support Library
    implementation 'pub.devrel:easypermissions:2.0.1'
    //    implementation files('libs/com.supermap.data_v910.jar')
    //    implementation files('libs/com.supermap.mapping_v910.jar')
    implementation 'com.google.code.gson:gson:2.8.2'
    //
    //    implementation files('libs/com.supermap.navigation_v910.jar')
   // implementation project(':aR')

    api 'com.google.ar:core:1.25.0'
    api 'com.google.android.filament:filament-android:1.7.0'
    api 'com.google.android.filament:gltfio-android:1.7.0'
    api 'com.google.android.filament:filament-utils-android:1.9.25'
}

您那边试下修改一下arCore的版本,改为1.11.0.如果还是不行可以将您的demo整理一下私信发我,我这边排查一下

您好,根据早上的回帖建议,我把 依赖 'com.google.ar:core:1.25.0'  ===== > 改为了:api 'com.google.ar:core:111.0'

很高兴没有再报相同的错误了,但是还是跟点击各个界面按钮,还是没反应,对应的回调也没有log打印。
关于私信,我好像不能发你私信,是不是我等级不够?我可以直接在帖子里发文件网盘吗?
 

可以直接在评论区发送网盘地址哈
您好,麻烦了~

链接: https://pan.baidu.com/s/170a3mFDNBbNE85g9GWKASw?pwd=6cut 提取码: 6cut
收到,解决后回复您

您好,那个demo没有完善,我这边和产品团队沟通下。AR测量您那边可以参考我们的示范程序:

AR测量(ARCartograph)
您好,您的意思会帮 更新好的的示例程序 放到官网的下载资源更新对吧?

我的demo 其实也能在上面的图片看到,也是根据示例程序的demo 界面搬过来的,现在的示例程序感觉还差点功能逻辑,所以才麻烦到您这边跟紧下,麻烦了。
您那边可以使用我上面发的这个ar测量的demo哈
...