ARFoundation在分裂的AndroidAppBundle上无法工作
创始人
2024-09-13 01:30:20
0

在build.gradle文件中添加以下代码:

android {
    ...

    // Enabling split APKs support
    bundle {
        language {
            enableSplit = false
        }
        density {
            enableSplit = true
        }
        abi {
            enableSplit = true
        }
    }

    // Enabling ARCore support with multi-APK
    flavorDimensions "default"
    productFlavors {
        arcore {
            dimension "default"
            versionCode 101010100 // VersionCode for ARCore APK.
            versionName "ARCore 1.10.1"
            manifestPlaceholders = [arcoreEnabled: "true"]
        }
        noarcore {
            dimension "default"
            versionCode 101010000 // VersionCode for non-ARCore APK.
            versionName "noARCore"
            manifestPlaceholders = [arcoreEnabled: "false"]
        }
    }

    ...

    aaptOptions {
        noCompress "tflite"
        noCompress "lite"
    }
}

这将禁用语言分裂,但启用屏幕密度和ABI分裂。在此示例中,我们同时启用了ARCore支持,并为ARCore APK和非ARCore APK设置了不同的版本号。

需要注意的一点是,ARCore应该在每个APK中具有相同的版本,而且版本大小应该尽量小,以减少用户下载时的数据量。

dependencies {
    // ARCore should be included in the module that can use AR.
    implementation "com.google.ar:core:1.20.0"

    // AR Foundation
    implementation "com.unity.xr.arfoundation:arfoundation:3.1.0"
    implementation "com.unity.xr.arcore:arcore-sdk:3.1.0"

    // ARCore Extensions
    implementation "com.unity.xr.arcoreextensions:core:1.0.0-preview.21"
    implementation "com.unity.xr.arcoreextensions:face:1.0.0-preview.21"
}

然后,在AndroidManifest.xml中添加以下代码来启用ARCore和ARKit的兼容性:




最后,在实现AR Foundation的Activity中,将以下代码添加到onCreate()方法中:

if (!isSupportedDevice

相关内容

热门资讯

透视科技!hhpoker万能辅... 透视科技!hhpoker万能辅助器,hhpoker到底可以作弊吗,线上教程(往昔真的是有挂);亲,其...
透视线上!hhpoker怎么开... 透视线上!hhpoker怎么开透视,wpk软件是正规的吗,必备教程(原先是有挂);值得一提的是,hh...
透视脚本!wepoker透视底... 【福星临门,好运相随】;透视脚本!wepoker透视底牌脚本,德普之星透视辅助软件,微扑克教程(果然...
透视ai代打!aapoker透... 透视ai代打!aapoker透视脚本,wejoker免费脚本,必赢方法(一直有挂);科技安装教程;1...
透视有挂!hhpoker透视脚... 透视有挂!hhpoker透视脚本,wejoker免费脚本,专业教程(一直有挂);揭秘教程安装方法样式...
透视肯定!wpk辅助插件,佛手... 透视肯定!wpk辅助插件,佛手大菠萝辅助,德州论坛(一直存在有挂);亲,其实确实真的有挂(需添加指定...
透视安卓版!wepoker辅助... 透视安卓版!wepoker辅助下载,werplan外卦神器,可靠教程(素来存在有挂);科技安装教程;...
透视存在!wepoker透视脚... 透视存在!wepoker透视脚本免费下载,pokeplus脚本,我来教教你(原来存在有挂);wepo...
透视讲解!wepoker作弊辅... 透视讲解!wepoker作弊辅助,aapoker透视脚本,透明挂教程(果然真的有挂);亲,其实确实真...
辅助透视!德普之星有没有挂,w... 辅助透视!德普之星有没有挂,wepoker透视脚本苹果版,2025新版总结(果然是真的有挂)科技教程...