Search code examples
androidandroid-studioaugmented-realityarcoresceneform

How to setup Sceneform SDK 1.16 for Android Studio


From what I understand, as of March 2020, the Scenform SDK is now open source, and is available on GitHub. But the Sceneform documentation on Google Developers is for the old one.

What is the proper way to set up a Sceneform project in Android Studio in 2020? There always seems to be issues - whether it'd be gradle-related, problems with edit-configuration, etc. Android development is already tricky enough in general. How do I do this?


Solution

  • You can easily download Sceneform 1.16

    For this launch the latest version of Android Studio and go to...:

    • Win : File > Settings > Plugins > Browse Repositories
    • Mac : Android Studio > Preferences > Plugins

    ...click Browse repositories, and then choose the Google Sceneform Tools (Beta).


    Configure build.gradle and AndroidManifest.xml files

    After this you need to configure your APPS build.gradle files the same way you did it for ARCore. Sceneform and ARCore UX dependencies should look like this:

    dependencies {
        implementation 'com.google.ar:core:1.16.0'
        implementation files("../libs/libsceneform_runtime_schemas.jar")
    }
    

    Also, you have to modify AndroidManifest.xml file to indicate that your app uses AR Optional or requires AR Required ARCore and CAMERA access:

    <uses-permission android:name="android.permission.CAMERA" />
    <uses-feature android:glEsVersion="0x00030000" android:required="true" />
    <uses-feature android:name="android.hardware.camera.ar" />
    
    <application>
        <meta-data android:name="com.google.ar.core" android:value="required" />
    </application>
    

    Here you can find a thorough instruction how you can do it.