05-09 12:48:16.937 17491-17491/com.google.ar.sceneform.samples.solarsystem E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.google.ar.sceneform.samples.solarsystem, PID: 17491
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.ar.sceneform.samples.solarsystem/com.google.ar.sceneform.samples.solarsystem.SolarActivity}: android.view.InflateException: Binary XML file line #23: Binary XML file line #23: Error inflating class com.google.ar.sceneform.ArSceneView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: android.view.InflateException: Binary XML file line #23: Binary XML file line #23: Error inflating class com.google.ar.sceneform.ArSceneView
Caused by: android.view.InflateException: Binary XML file line #23: 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:334)
at android.view.LayoutInflater.createView(LayoutInflater.java:647)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.google.ar.sceneform.samples.solarsystem.SolarActivity.onCreate(SolarActivity.java:89)
at android.app.Activity.performCreate(Activity.java:7009)
at android.app.Activity.performCreate(Activity.java:7000)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.IllegalStateException: Couldn't create Engine
at com.google.android.filament.Engine.create(Engine.java:51)
at com.google.ar.sceneform.rendering.EngineInstance.createEngine(EngineInstance.java:52)
at com.google.ar.sceneform.rendering.EngineInstance.getEngine(EngineInstance.java:23)
at com.google.ar.sceneform.rendering.Renderer.initialize(Renderer.java:491)
at com.google.ar.sceneform.rendering.Renderer.
at com.google.ar.sceneform.SceneView.initialize(Unknown Source:31)
at com.google.ar.sceneform.SceneView.
at com.google.ar.sceneform.ArSceneView.
at java.lang.reflect.Constructor.newInstance0(Native Method)Â
at java.lang.reflect.Constructor.newInstance(Constructor.java:334)Â
at android.view.LayoutInflater.createView(LayoutInflater.java:647)Â
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)Â
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)Â
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)Â
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)Â
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)Â
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)Â
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)Â
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)Â
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)Â
at com.google.ar.sceneform.samples.solarsystem.SolarActivity.onCreate(SolarActivity.java:89)Â
at android.app.Activity.performCreate(Activity.java:7009)Â
at android.app.Activity.performCreate(Activity.java:7000)Â
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)Â
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)Â
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)Â
at android.app.ActivityThread.-wrap11(Unknown Source:0)Â
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)Â
at android.os.Handler.dispatchMessage(Handler.java:106)Â
at android.os.Looper.loop(Looper.java:164)Â
at android.app.ActivityThread.main(ActivityThread.java:6494)Â
at java.lang.reflect.Method.invoke(Native Method)Â
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)Â
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)Â
Hi @ronindong - Thank you for the report! If you would share some more info that would be very helpful as we debug this:
What Android device (Device model & android OS version) were you running that encountered this issue?
If possible, will you share the full output from logcat with us? You can either attach to this issue, or if you prefer, email it to me directly. Thanks!
Sceneform requires OpenGL ES 3.1 or later.
The most likely cause of this error message is running on a platform that doesn't support OpenGL ES 3.1. There should be log messages before this that will give more detail.
Thanks! @malikcoates-at-work @tpsiaki
I'm using the emulator.And The arcore sample can run, but the sceneform sample cann't run.
How should we solve it?
@malik-at-work Is there a way to choose openGL versions? My device should support 3.1, but I get the same error.
in static std::unique_ptr<Driver> filament::OpenGLDriver::create(filament::driver::ContextManagerGL *const, void *const)
at line 80
in file /usr/local/google/home/mathias/sources/git/tnt/filament/filament/src/driver/opengl/OpenGLDriver.cpp
reason: OpenGL ES 3.1 minimum needed (current 3.0)
@fatahfattah @ronindong
To run Sceneform apps in the emulator:
OpenGL ES 3.1 must be supported and enabled in the Android Emulator.
Make sure your emulator is configured to use the latest version. In the menu, select Settings > Advanced > Renderer maximum (up to OpenGL ES 3.1).
Run the emulator and check whether OpenGl ES 3.1 is being used:
adb logcat | grep eglMakeCurrent
If you see ver 3 1, then you can run Sceneform apps. If you see a lower version, then your desktop GPU does not support OpenGL ES 3.1 and you must use a supported device to run Sceneform apps.
OpenGL ES 3.1 support in the Android Emulator requires a modern desktop GPU. We are looking into support for older GPUs for future releases.
I'm seeing this error on my 2018 MacBook pro. Is that normal? After following the steps above, adb logcat | grep eglMakeCurrent only reports 3.0 being available.
@kanawish That sounds correct. If only 3.0 is reported then Sceneform 1.0 can not run in emulator and the best choice will be to install on a supported device. As mentioned up thread we are looking into support for older versions of OpenGL.
I'm a bit curious how to find out what devices/computer configurations will support OpenGL ES 3.1 in the emulators. Is there a OpenGL vs OpenGL ES correspondence chart? For example, my Macbook has a Radeon Pro 555, and reports supporting up to OpenGL 4.1 Desktop version in the "OpenGL extensions viewer" tool.
@kanawish There is no exact correspondence. OpenGL ES 3.1 in particular requires features that are only available in OpenGL 4.2 and higher. We are exploring solutions to get Sceneform to run properly on the emulator on macOS.
@kanawish To add to what @romainguy said, in case you didn't know already, 4.1 core is the current maximum OpenGL version on Mac for all macOS devices that I know of. To properly support OpenGL ES 3.1, features such as SSBOs and compute shaders must also be included, and they are in OpenGL 4.3+.
The emulator queries the entry points of your OpenGL driver to determine the maximum possible supported version. However, even then, it might not be safe to use modern openGL on that particular GPU since we've had problems with GPUs that do not behave well even after advertising support, hence the whitelist.
On Windows/Linux with a modern GPU where 4.3+ is supported, you may both force OpenGL ES 3.x and bypass whitelist and other checks to get a ES 3.1 context by passing
-feature GLESDynamicVersion,-PlayStoreImage
to the command line. Alternatively, put the lines
GLESDynamicVersion = on
PlayStoreImage = off
into ~/.android/advancedFeatures.ini (create this file if it does not exist already). Then, the emulator will attempt to use ES 3.1 if the entry points exposed by your GPU driver are sufficient.
That's really great context, thanks everyone!
Just a note, in an upcoming release the requirement drops from OpenGL ES 3.1 to 3.0.
Sceneform 1.4 is now available which supports OpenGL ES 3.0, please give the new version a try!
Closing this issue, please reopen or create a new issue if you're still encountering it with Sceneform 1.4.
Caused by: android.view.InflateException: Binary XML file line #9: Binary XML file line #22: Binary XML file line #22: Error inflating class com.google.ar.sceneform.ArSceneView
Caused by: android.view.InflateException: Binary XML file line #22: Binary XML file line #22: Error inflating class com.google.ar.sceneform.ArSceneView
Caused by: android.view.InflateException: Binary XML file line #22: Error inflating class com.google.ar.sceneform.ArSceneView
i get the error.
can you tell me how to handle it?
I was getting this error as I was using different libraries
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.10.0"
implementation "com.google.ar.sceneform:animation:1.8.0"
See v10 and v8 being used together.
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.10.0"
implementation "com.google.ar.sceneform:animation:1.10.0"
Updated both! Error is gone now!
Most helpful comment
Just a note, in an upcoming release the requirement drops from OpenGL ES 3.1 to 3.0.