google-ar / sceneform-android-sdk

Sceneform SDK for Android
https://developers.google.com/sceneform/develop/
Apache License 2.0
1.23k stars 604 forks source link

Error inflating class com.google.ar.sceneform.ArSceneView #849

Open chnouman opened 5 years ago

chnouman commented 5 years ago
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.visionx.loop/com.x.x.AugmentedImageActivity}: android.view.InflateException: Binary XML file line #23: Binary XML file line #22: Binary XML file line #22: Error inflating class com.google.ar.sceneform.ArSceneView
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
        at android.app.ActivityThread.-wrap12(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:154)
        at android.app.ActivityThread.main(ActivityThread.java:6077)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
     Caused by: android.view.InflateException: Binary XML file line #23: 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
     Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Constructor.newInstance0(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
        at android.view.LayoutInflater.createView(LayoutInflater.java:645)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:858)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
        at com.google.ar.sceneform.ux.BaseArFragment.onCreateView(BaseArFragment.java:137)
        at com.visionx.loop.AugmentedImageFragment.onCreateView(AugmentedImageFragment.java:72)
        at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2595)
        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:3202)
        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.createViewFromTag(LayoutInflater.java:777)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:858)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:377)
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
        at com.visionx.loop.AugmentedImageActivity.onCreate(AugmentedImageActivity.java:34)
        at android.app.Activity.performCreate(Activity.java:6662)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
2019-09-04 15:18:34.841 19834-19834/com.visionx.loop E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
        at android.app.ActivityThread.-wrap12(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:154)
        at android.app.ActivityThread.main(ActivityThread.java:6077)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
     Caused by: java.lang.IllegalStateException: Couldn't create Engine
        at com.google.android.filament.Engine.create(Engine.java:65)
        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:440)
        at com.google.ar.sceneform.rendering.Renderer.<init>(Renderer.java:84)
        at com.google.ar.sceneform.SceneView.initialize(SourceFile:73)
        at com.google.ar.sceneform.SceneView.<init>(SourceFile:19)
        at com.google.ar.sceneform.ArSceneView.<init>(SourceFile:9)
            ... 42 more

Here is my manifest file:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.x.x">

    <!--necessary-->
    <uses-permission android:name="android.permission.CAMERA"/>

    <!-- This tag indicates that this application requires ARCore.  This results in the application
         only being visible in the Google Play Store on devices that support ARCore. -->
    <uses-feature android:name="android.hardware.camera.ar" android:required="true"/>

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        android:usesCleartextTraffic="false"
        >
        <activity android:name=".MainActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.Translucent"
            >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <!-- This tag indicates that this application requires ARCore.  This results in the Google Play
         Store downloading and installing ARCore along with the application. -->
        <meta-data android:name="com.google.ar.core" android:value="required" />
        <activity
            android:name=".AugmentedImageActivity"
            android:configChanges="orientation|screenSize"
            android:exported="true"
            android:theme="@style/Theme.AppCompat.NoActionBar"
            android:screenOrientation="locked"/>

    </application>

</manifest>
apv154 commented 4 years ago

Hi, this same problem is happening to me. Did you get any solution?

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.test1, PID: 19104
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test1/com.example.test1.MainActivity}: 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
        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 #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
     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 com.google.ar.sceneform.ux.BaseArFragment.onCreateView(BaseArFragment.java:126)
        at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2439)
        at androidx.fragment.app.FragmentManagerImpl.ensureInflatedFragmentView(FragmentManager.java:1689)
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1431)
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1684)
        at androidx.fragment.app.FragmentManagerImpl.addFragment(FragmentManager.java:1930)
        at androidx.fragment.app.FragmentManagerImpl.onCreateView(FragmentManager.java:3745)
        at androidx.fragment.app.FragmentController.onCreateView(FragmentController.java:120)
        at androidx.fragment.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:405)
        at androidx.fragment.app.FragmentActivity.onCreateView(FragmentActivity.java:387)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:780)
        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 androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
        at com.example.test1.MainActivity.onCreate(MainActivity.java:48)
        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)
E/AndroidRuntime:     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:376)
        at com.google.ar.sceneform.rendering.Renderer.<init>(Renderer.java:112)
        at com.google.ar.sceneform.SceneView.initialize(Unknown Source:31)
        at com.google.ar.sceneform.SceneView.<init>(Unknown Source:39)
        at com.google.ar.sceneform.ArSceneView.<init>(Unknown Source:0)
            ... 42 more