收藏
回答

XRFRAME-2dmarker真机预览不显示?开发工具看不了

组件代码:

<xr-scene ar-system="modes:Marker" id="xr-scene" bind:ready="handleReady" bind:ar-ready="handleARReady">
    <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
        <xr-asset-load type="gltf" asset-id="gltf" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/butterfly/index.glb" />
    </xr-assets>
    <xr-env env-data="xr-frame-team-workspace-day" />
    <xr-node wx:if="{{arReady}}">
        <xr-ar-tracker mode="Marker" src="{{markerImg}}">
            <xr-gltf model="gltf" anim-autoplay position="0.2 0 -0.2" scale="0.6 0.6 0.6" rotation="0 -50 0" />
            <xr-gltf model="gltf" anim-autoplay position="0.4 0 0.3" scale="0.5 0.5 0.5" rotation="0 -50 0" />
            <xr-gltf model="gltf" anim-autoplay position="-0.3 0 0.3" scale="0.4 0.4 0.4" rotation="0 -50 0" />
        </xr-ar-tracker>
        <xr-camera id="camera" node-id="camera" position="0.8 2.2 -5" clear-color="0.925 0.925 0.925 1" background="ar" is-ar-camera></xr-camera>
    </xr-node>
    <xr-node node-id="lights">
        <xr-light type="ambient" color="1 1 1" intensity="1" />
        <xr-light type="directional" rotation="180 0 0" color="1 1 1" intensity="3" />
    </xr-node>
</xr-scene>


// components/xr-scene/xr-scene.js
Component({
    /**
     * 组件的属性列表
     */
    properties: {
        markerImg: {
            type: String
        },
    },
    /**
     * 组件的初始数据
     */
    data: {
        loaded: false,
        arReady: false,
    },
    lifetimes: {
        attached() {
            console.log('data', this.data)
        }
    },
    /**
     * 组件的方法列表
     */
    methods: {
        handleReady({
            detail
        }) {
            const xrScene = this.scene = detail.value;
            console.log('xr-scene', xrScene);
        },
        handleAssetsProgress: function ({
            detail
        }) {
            console.log('assets progress', detail.value);
        },
        handleAssetsLoaded: function ({
            detail
        }) {
            console.log('assets loaded', detail.value);
            this.setData({
                loaded: true
            });
        },
        handleARReady: function ({
            detail
        }) {
            console.log('arReady');
            this.setData({
                arReady: true
            })
        }
    }
})


分包也设置了,空的

{
  "pages": [
    "pages/index/index"
  ],
  "subpackages": [],
  "window": {
    "navigationBarTextStyle": "black",
    "navigationStyle": "custom"
  },
  "style": "v2",
  "renderer": "skyline",
  "rendererOptions": {
    "skyline": {
      "defaultDisplayBlock": true,
      "disableABTest": true,
      "sdkVersionBegin": "3.0.0",
      "sdkVersionEnd": "15.255.255"
    }
  },
  "componentFramework": "glass-easel",
  "sitemapLocation": "sitemap.json",
  "lazyCodeLoading": "requiredComponents"
}

截图:

手机是安卓8.0.41

开发工具已经是最新的了


回答关注问题邀请回答
收藏

2 个回答

  • Roam
    Roam
    2023-09-20

    用预览,别用真机调试

    2023-09-20
    有用
    回复
  • 烈鸟
    烈鸟
    2023-09-20

    自记录

    问题1:安卓是8.0.41版本,真机调试Server Certificate not trusted

    换了微信开发者版本了,不报问题1了,新的问题出来了

    问题2:No any glass-easel component configs found in space, may be not a valid code package 咱也不知道这都是咋的了,开发者工具也是新的

    2023-09-20
    有用
    回复 1
    • 蜜桃半岛
      蜜桃半岛
      2023-10-23
      你好 你的问题解决了吗 我也是这个错误
      2023-10-23
      回复
登录 后发表内容