Search code examples
androidvirtual-realitygoogle-vrpanoramas360-panorama

ViroCore: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/vr/ndk/base/GvrLayout;


I have downloaded ViroCore lib the latest version (virocore-release-v_1_7_2.aar), then I added dependencies below to my build.gradle file

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:25.0.0'
implementation 'com.google.android.exoplayer:exoplayer:r2.2.0'
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
implementation (name:'virocore-release-v_1_7_2', ext: 'aar')
implementation 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
implementation 'com.amazonaws:aws-android-sdk-core:2.2.+'
implementation 'com.amazonaws:aws-android-sdk-ddb:2.2.+'
implementation 'com.amazonaws:aws-android-sdk-ddb-mapper:2.2.+'
implementation 'com.amazonaws:aws-android-sdk-cognito:2.2.+'
implementation 'com.amazonaws:aws-android-sdk-cognitoidentityprovider:2.2.+'}

and then wrote to my ViroActivity code below:

private ViroView createGVRView() {
    return new ViroViewGVR(this, new ViroViewGVR.StartupListener() {

        @Override
        public void onSuccess() {
            onRendererStart();
        }

        @Override
        public void onFailure(ViroViewGVR.StartupError error, String errorMessage) {
            onRendererFailed(error.toString(), errorMessage);
        }
    }, new Runnable() {
        @Override
        public void run() {
        }
    });

}

But when run the app, I always see next Exception:

E/AndroidRuntime: FATAL EXCEPTION: main
              Process: com.example.virosample.gvr.ovr, PID: 17304
              java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/vr/ndk/base/GvrLayout;
                  at com.viro.core.ViroViewGVR.init(ViroViewGVR.java:287)
                  at com.viro.core.ViroViewGVR.<init>(ViroViewGVR.java:211)
                  at com.example.panorama.ui.view.ViroActivityVR.createGVRView(ViroActivityVR.java:104)
                  at com.example.panorama.ui.view.ViroActivityVR.onCreate(ViroActivityVR.java:90)
                  ...

Anyone knows how to resolve this exception?


Solution

  • I solved this issue. I added to my dependency just viro library, but I must add additionally both sdk-common.aar and core.aar which you can download at the official virocore site.