我关注了:https://github.com/google-ar/sceneform-android-sdk
并添加了
Finally, add a reference to the Sceneform SDK to your app's build.gradle:
dependencies {
api project(":sceneformux")
}但是我得到了一个错误
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :sceneformux.我错过了什么吗。
在执行完这些步骤后,我也得到了以下不存在的错误。
import com.google.ar.sceneform.AnchorNode;
import com.google.ar.sceneform.rendering.ModelRenderable;
import com.google.ar.sceneform.ux.ArFragment;
import com.google.ar.sceneform.ux.BaseArFragment;
import com.google.ar.sceneform.ux.TransformableNode;
import com.google.ar.sceneform.math.Quaternion;
import com.google.ar.sceneform.math.Vector3;发布于 2020-12-29 20:40:32
看起来你的Android Studio找不到sceneformux模块。
您可以将其添加到您的项目中,如您共享的链接中的步骤所述-特别是:
项目
+--应用
+-- build.gradle
+-- ...
+--场景格式sceneformsrc
+--场景
+-- build.gradle
+-- settings.gradle
+-- ...
//添加以下行:
包含':sceneform‘
项目(‘:sceneform’).projectDir=new文件(‘sceneformsrc/sceneform’)
包含':sceneformux‘
项目(‘:sceneformux’).projectDir=new文件(‘sceneformux/ux’)
假设你做了以上所有的事情,那么可能是Android studio没有同步到你复制到项目中的目录sceneformsrc和sceneformux。
你现在很可能已经解决了这个问题,但为了完整起见,我看到了类似的东西,虽然Android Studio中可能有更精确的同步选项来解决这个问题,但我发现退出Android Studio并重启它通常可以解决这类问题,在这种情况下也是如此。
https://stackoverflow.com/questions/63497718
复制相似问题