英文:
Error inflating class com.google.ar.sceneform.ArSceneView
问题
以下是您的错误日志的翻译:
我遇到了一个错误,这是我的 Logcat 日志:
2020-07-26 12:14:50.756 30507-30507/com.tuto.myapplication E/AndroidRuntime: 致命异常:主要进程
进程:com.tuto.myapplication,PID:30507
java.lang.RuntimeException:无法启动活动 ComponentInfo{com.tuto.myapplication/com.tuto.myapplication.MainActivity}:android.view.InflateException:com.tuto.myapplication:layout/activity_main 中的二进制 XML 文件第27行:com.tuto.myapplication:layout/sceneform_ux_fragment_layout 中的二进制 XML 文件第22行:com.tuto.myapplication:layout/sceneform_ux_fragment_layout 中的二进制 XML 文件第22行:Error inflating class com.google.ar.sceneform.ArSceneView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3782)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
Caused by: android.view.InflateException:com.tuto.myapplication:layout/activity_main 中的二进制 XML 文件第27行:com.tuto.myapplication:layout/sceneform_ux_fragment_layout 中的二进制 XML 文件第22行:com.tuto.myapplication:layout/sceneform_ux_fragment_layout 中的二进制 XML 文件第22行:Error inflating class com.google.ar.sceneform.ArSceneView
Caused by: android.view.InflateException:com.tuto.myapplication:layout/sceneform_ux_fragment_layout 中的二进制 XML 文件第22行:com.tuto.myapplication:layout/sceneform_ux_fragment_layout 中的二进制 XML 文件第22行:Error inflating class com.google.ar.sceneform.ArSceneView
Caused by: android.view.InflateException:com.tuto.myapplication:layout/sceneform_ux_fragment_layout 中的二进制 XML 文件第22行:Error inflating class com.google.ar.sceneform.ArSceneView
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.createViewFromTag(LayoutInflater.java:1016)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:971)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1133)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1094)
at android.view.LayoutInflater.inflate(LayoutInflater.java:692)
at android.view.LayoutInflater.inflate(LayoutInflater.java:536)
at com.google.ar.sceneform.ux.BaseArFragment.onCreateView(BaseArFragment.java:162)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2600)
at androidx.fragment.app.FragmentManagerImpl.ensureInflatedFragmentView(FragmentManagerImpl.java:1138)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:851)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1133)
at androidx.fragment.app.FragmentManagerImpl.addFragment(FragmentManagerImpl.java:1393)
at androidx.fragment.app.FragmentManagerImpl.onCreateView(FragmentManagerImpl.java:3205)
at androidx.fragment.app.FragmentController.onCreateView(FragmentController.java:134)
at androidx.fragment.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:357)
at androidx.fragment.app.FragmentActivity.onCreateView(FragmentActivity.java:336)
at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1079)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1007)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:971)
2020-07-26 12:14:50.758 30507-30507/com.tuto.myapplication E/AndroidRuntime: at android.view.LayoutInflater.rInflate(LayoutInflater.java:1133)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
at com.tuto.myapplication.MainActivity.onCreate(MainActivity.java:77)
at android.app.Activity.performCreate(Activity.java:8086)
at android.app.Activity.performCreate(Activity.java:8074)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1313)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/filament/gltfio/Gltfio;
at com.google.ar.sceneform.rendering.EngineInstance.gltfioInit(EngineInstance.java:96)
at com.google.ar.sceneform.rendering.EngineInstance.createEngine(EngineInstance.java:110)
at com.google.ar.sceneform.rendering.EngineInstance.getEngine(EngineInstance.java:42)
at com.google.ar.sceneform.rendering.Renderer.initialize(Renderer.java:542)
at com.google.ar.sceneform.rendering.Renderer.<init>(Renderer.java:109)
at com.google.ar.sceneform.SceneView.initialize(SourceFile:37)
...
this is my code(这是我的代码):
MainActivity.java:
...
activity_main.xml:
...
customArFragment:
...
//EDIT1: Just edited the stacktrace in order to be exploitable.
请注意,由于您只需要翻译代码部分,我已将异常的翻译省略掉,只保留了代码、XML 和注释的翻译。如果您有更多需要帮助的问题,请随时提问。
英文:
I have an error this is my Logcat
2020-07-26 12:14:50.756 30507-30507/com.tuto.myapplication E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.tuto.myapplication, PID: 30507
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tuto.myapplication/com.tuto.myapplication.MainActivity}: android.view.InflateException: Binary XML file line #27 in com.tuto.myapplication:layout/activity_main: Binary XML file line #22 in com.tuto.myapplication:layout/sceneform_ux_fragment_layout: Binary XML file line #22 in com.tuto.myapplication:layout/sceneform_ux_fragment_layout: Error inflating class com.google.ar.sceneform.ArSceneView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3782)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
Caused by: android.view.InflateException: Binary XML file line #27 in com.tuto.myapplication:layout/activity_main: Binary XML file line #22 in com.tuto.myapplication:layout/sceneform_ux_fragment_layout: Binary XML file line #22 in com.tuto.myapplication:layout/sceneform_ux_fragment_layout: Error inflating class com.google.ar.sceneform.ArSceneView
Caused by: android.view.InflateException: Binary XML file line #22 in com.tuto.myapplication:layout/sceneform_ux_fragment_layout: Binary XML file line #22 in com.tuto.myapplication:layout/sceneform_ux_fragment_layout: Error inflating class com.google.ar.sceneform.ArSceneView
Caused by: android.view.InflateException: Binary XML file line #22 in com.tuto.myapplication:layout/sceneform_ux_fragment_layout: Error inflating class com.google.ar.sceneform.ArSceneView
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343) android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1016)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:971)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1133)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1094)
at android.view.LayoutInflater.inflate(LayoutInflater.java:692)
at android.view.LayoutInflater.inflate(LayoutInflater.java:536)
at com.google.ar.sceneform.ux.BaseArFragment.onCreateView(BaseArFragment.java:162)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2600)
at androidx.fragment.app.FragmentManagerImpl.ensureInflatedFragmentView(FragmentManagerImpl.java:1138)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:851)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1133)
at androidx.fragment.app.FragmentManagerImpl.addFragment(FragmentManagerImpl.java:1393)
at androidx.fragment.app.FragmentManagerImpl.onCreateView(FragmentManagerImpl.java:3205)
at androidx.fragment.app.FragmentController.onCreateView(FragmentController.java:134)
at androidx.fragment.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:357)
at androidx.fragment.app.FragmentActivity.onCreateView(FragmentActivity.java:336)
at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1079)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1007)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:971)
2020-07-26 12:14:50.758 30507-30507/com.tuto.myapplication E/AndroidRuntime: at android.view.LayoutInflater.rInflate(LayoutInflater.java:1133)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
at com.tuto.myapplication.MainActivity.onCreate(MainActivity.java:77)
at android.app.Activity.performCreate(Activity.java:8086)
at android.app.Activity.performCreate(Activity.java:8074)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1313)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/filament/gltfio/Gltfio;
at com.google.ar.sceneform.rendering.EngineInstance.gltfioInit(EngineInstance.java:96)
at com.google.ar.sceneform.rendering.EngineInstance.createEngine(EngineInstance.java:110)
at com.google.ar.sceneform.rendering.EngineInstance.getEngine(EngineInstance.java:42)
at com.google.ar.sceneform.rendering.Renderer.initialize(Renderer.java:542)
at com.google.ar.sceneform.rendering.Renderer.<init>(Renderer.java:109)
at com.google.ar.sceneform.SceneView.initialize(SourceFile:37)
2020-07-26 12:14:50.759 30507-30507/com.tuto.myapplication E/AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.filament.gltfio.Gltfio" on path: DexPathList[[zip file "/data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/base.apk", zip file "/data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_dependencies_apk.apk", zip file "/data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_resources_apk.apk", zip file "/data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_slice_0_apk.apk", zip file "/data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_slice_1_apk.apk", zip file "/data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_slice_2_apk.apk", zip file "/data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_slice_3_apk.apk", zip file "/data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_slice_4_apk.apk", zip file "/data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_slice_5_apk.apk", zip file "/data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_slice_6_apk.apk", zip file "/data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_slice_7_apk.apk", zip file "/data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_slice_8_apk.apk", zip file "/data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/lib/arm64, /data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/base.apk!/lib/arm64-v8a, /data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_dependencies_apk.apk!/lib/arm64-v8a, /data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_resources_apk.apk!/lib/arm64-v8a, /data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_slice_0_apk.apk!/lib/arm64-v8a, /data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_slice_1_apk.apk!/lib/arm64-v8a, /data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_slice_2_apk.apk!/lib/arm64-v8a, /data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_slice_3_apk.apk!/lib/arm64-v8a, /data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_slice_4_apk.apk!/lib/arm64-v8a, /data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_slice_5_apk.apk!/lib/arm64-v8a, /data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_slice_6_apk.apk!/lib/arm64-v8a, /data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_slice_7_apk.apk!/lib/arm64-v8a, /data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_slice_8_apk.apk!/lib/arm64-v8a, /data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_slice_9_apk.apk!/lib/arm64-v8a, /system/lib64, /system/product/lib64, /hw_product/lib64, /system/product/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 53 more
Suppressed: java.io.IOException: No original dex files found for dex location /data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_resources_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:365)
at dalvik.system.DexFile.<init>(DexFile.java:107)
at dalvik.system.DexFile.<init>(DexFile.java:80)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:444)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:403)
at dalvik.system.DexPathList.<init>(DexPathList.java:164)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:126)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:101)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:74)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:87)
2020-07-26 12:14:50.759 30507-30507/com.tuto.myapplication E/AndroidRuntime: at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:116)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:130)
at android.app.ApplicationLoaders.getClassLoaderWithSharedLibraries(ApplicationLoaders.java:75)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:914)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:1015)
at android.app.LoadedApk.getResources(LoadedApk.java:1264)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2611)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2599)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7075)
at android.app.ActivityThread.access$2200(ActivityThread.java:296)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2208)
... 6 more
Suppressed: java.io.IOException: No original dex files found for dex location /data/app/com.tuto.myapplication-R6xbR4NAzgk5zRoAjKzIxA==/split_lib_slice_0_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:365)
at dalvik.system.DexFile.<init>(DexFile.java:107)
at dalvik.system.DexFile.<init>(DexFile.java:80)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:444)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:403)
at dalvik.system.DexPathList.<init>(DexPathList.java:164)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:126)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:101)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:74)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:87)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:116)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:130)
at android.app.ApplicationLoaders.getClassLoaderWithSharedLibraries(ApplicationLoaders.java:75)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:914)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:1015)
at android.app.LoadedApk.getResources(LoadedApk.java:1264)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2611)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2599)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7075)
at android.app.ActivityThread.access$2200(ActivityThread.java:296)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2208)
... 6 more
this is my code
MainActivity.java:
public class MainActivity extends AppCompatActivity implements Scene.OnUpdateListener {
private customArFragment mCustomArFragment;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
try {
mCustomArFragment = (customArFragment) getSupportFragmentManager().findFragmentById(R.id.fragment);
mCustomArFragment.getArSceneView().getScene().addOnUpdateListener(this);
}catch (Exception e){
e.printStackTrace();
}
}
public void setUpDatabase(Config config, Session session){
Bitmap nature = BitmapFactory.decodeResource(getResources(),R.drawable.nature);
AugmentedImageDatabase aid = new AugmentedImageDatabase(session);
aid.addImage("nature" , nature);
config.setAugmentedImageDatabase(aid);
}
@Override
public void onUpdate(FrameTime frameTime) {
Frame frame = mCustomArFragment.getArSceneView().getArFrame();
Collection<AugmentedImage> images = frame.getUpdatedTrackables(AugmentedImage.class);
for (AugmentedImage image : images){
if (image.getTrackingState() == TrackingState.TRACKING){
if (image.getName().equals("nature")){
Anchor anchor = image.createAnchor(image.getCenterPose());
createModel(anchor);
}
}
}
}
private void createModel(Anchor anchor) {
ModelRenderable.builder()
.setSource(this , Uri.parse("untitled.sfb"))
.build()
.thenAccept(modelRenderable -> { placeModel(modelRenderable,anchor); });
}
private void placeModel(ModelRenderable modelRenderable, Anchor anchor) {
AnchorNode anchorNode = new AnchorNode(anchor);
anchorNode.setRenderable(modelRenderable);
mCustomArFragment.getArSceneView().getScene().addChild(anchorNode);
}
}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<fragment
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/fragment"
android:name="com.tuto.myapplication.customArFragment"/>
</androidx.constraintlayout.widget.ConstraintLayout>
customArFragment :
public class customArFragment extends ArFragment {
@Override
protected Config getSessionConfiguration(Session session) {
Config config = new Config(session);
config.setUpdateMode(Config.UpdateMode.LATEST_CAMERA_IMAGE);
config.setFocusMode(Config.FocusMode.AUTO);
session.configure(config);
this.getArSceneView().setupSession(session);
((MainActivity)getActivity()).setUpDatabase(config,session);
return config;
}
}
//EDIT1: Just edited the stacktrace in order to be exploitable.
答案1
得分: 4
我在使用API 29的AVD时遇到了相同的错误。在SDK管理器中,针对您选择的API级别,请下载**“Google APIs Intel x86 Atom系统镜像”或“Intel x86 Atom系统镜像”**,或者所有“Google API intel....”
注意:上述下载需要大量的空间和数据。
然后遇到另一个错误“Google Play服务用于AR的停止”。
对于这个错误,下面的链接有帮助:
https://developers.google.com/sceneform/develop/emulator
因此,这里是答案:
Sceneform 需要OpenGL ES 3.0或更高版本。
确保您的模拟器配置为使用最新版本的OpenGL ES:
点击运行模拟器工具栏中的“更多”。
选择“设置” > “高级” > “OpenGL ES API级别” > “渲染器最大值”(最高可达OpenGL ES 3.1)。
重新启动模拟器。在提示时,请不要保存当前状态。
在上面的链接中了解更多信息。
英文:
I was facing the same error with AVD for API 29. In SDK Manager, for your selected API level, download "Google APIs Intel x86 Atom System Image" or "Intel x86 Atom System Image" or all "Google API intel...."
Note: Above downloads requires huge space and data
Then faced another error "Google Play services for ar keeps stopping"
for this error below link helped
https://developers.google.com/sceneform/develop/emulator
So here is the answer
Sceneform requires OpenGL ES 3.0 or higher.
Make sure your emulator is configured to use the latest version of OpenGL ES:
Click More in the running emulator's toolbar.
Select Settings > Advanced > OpenGL ES API level > Renderer maximum (up to OpenGL ES 3.1).
Restart the emulator. When prompted, do not save the current state.
Check more on link above
答案2
得分: 1
这种类型的错误最常见的原因似乎是在不支持OpenGL ES 3.1或更高版本的设备上运行 - 请参阅此处的讨论:https://github.com/google-ar/sceneform-android-sdk/issues/4
这可能是在旧的或性能较差的设备上,或者在模拟器上运行时,平台上没有此版本或更高版本。
还有报告称,不匹配的Sceneform库可能会引起相同的问题(不确定错误是否完全相同)- 即上述讨论中的示例(版本已加粗以突出显示):
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.10.0"
implementation "com.google.ar.sceneform:animation:1.8.0"
英文:
The most common cause of this type of error seems to be running on devices which don't support OpenGL ES3.1 or later - see the discussion here: https://github.com/google-ar/sceneform-android-sdk/issues/4
This can be either on older or less capable devices or when running in the emulator on a platform that does not have this version or a later version.
There are also reports that having mismatched Sceneform libraries can cause the same problem (not sure if the error is 100% the same) - i.e. an example from the discussion above (with version bolded to highlight):
> implementation "com.google.ar.sceneform.ux:sceneform-ux:1.10.0"
>
> implementation "com.google.ar.sceneform:animation:1.8.0"
答案3
得分: 0
android{
....
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
英文:
build.gradle Add the following configuration to the file.
android{
....
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论