Android ViroCore:java.lang.NoClassDefFoundError:解析失败:Lcom/google/vr/ndk/base/GvrLayout;

Android ViroCore:java.lang.NoClassDefFoundError:解析失败:Lcom/google/vr/ndk/base/GvrLayout;,android,virtual-reality,google-vr,panoramas,360-panorama,Android,Virtual Reality,Google Vr,Panoramas,360 Panorama,我已经下载了ViroCore lib的最新版本(ViroCore-release-v_1_7_2.aar),然后在build.gradle文件中添加了以下依赖项 dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:25.0.0' implementation 'com.google.android.exopl

我已经下载了ViroCore lib的最新版本(ViroCore-release-v_1_7_2.aar),然后在build.gradle文件中添加了以下依赖项

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.+'}
然后写下我的病毒活性代码如下:

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() {
        }
    });
}

但在运行应用程序时,我总是会看到下一个异常:

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)
                  ...
E/AndroidRuntime:致命异常:主
进程:com.example.virosample.gvr.ovr,PID:17304
java.lang.NoClassDefFoundError:解析失败:Lcom/google/vr/ndk/base/GvrLayout;
位于com.viro.core.ViroViewGVR.init(ViroViewGVR.java:287)
位于com.viro.core.ViroViewGVR(ViroViewGVR.java:211)
位于com.example.panorama.ui.view.ViroActivityVR.createGVRView(ViroActivityVR.java:104)
位于com.example.panorama.ui.view.ViroActivityVR.onCreate(ViroActivityVR.java:90)
...

有人知道如何解决这个异常吗?

我解决了这个问题。我在依赖项中添加了viro库,但我必须另外添加sdk-common.aar和core.aar,您可以在官方virocore站点下载它们