Reputation: 3405
I get error while using Google VR
As this error
android.view.InflateException: Binary XML file line #44: Error inflating class com.google.vr.sdk.widgets.video.VrVideoView
This is my Layout:
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/gorilla_info"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:id="@+id/textView" />
<com.google.vr.sdk.widgets.video.VrVideoView
android:id="@+id/video_view"
android:layout_width="match_parent"
android:scrollbars="none"
android:layout_height="250dip"/>
<!-- Seeking UI & progress indicator.-->
<SeekBar
android:id="@+id/seek_bar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_height="32dp"
android:layout_width="fill_parent"/>
<TextView
android:id="@+id/status_text"
android:text="Loading Video..."
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:textSize="12sp"
android:paddingStart="32dp"
android:paddingEnd="32dp"/>
</LinearLayout>
This is my Build.gradle (Module: app):
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.google.devrel.vrviewapp"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ndk {
abiFilters "armeabi", "armeabi-v7a", "x86"
}
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile project(':gvr-android-sdk/libraries:common')
compile project(':gvr-android-sdk/libraries:commonwidget')
compile project(':gvr-android-sdk/libraries:panowidget')
compile project(':gvr-android-sdk/libraries:videowidget')
compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
}
It's failed on first line of onCreateView() method
View view = inflater.inflate(R.layout.gorilla_fragment, container,false);
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.gorilla_fragment, container,false);
seekBar = (SeekBar) view.findViewById(R.id.seek_bar);
statusText = (TextView) view.findViewById(R.id.status_text);
videoWidgetView = (VrVideoView) view.findViewById(R.id.video_view);
}
It's failed on all virtual devices and Real Devices.
What's the problem?
Thanks for your help.
Upvotes: 3
Views: 1050
Reputation: 33
I have same problem. Resolve by move to like that on Build.gradle
def vrVersion = "1.180.0"
dependencies {
implementation "com.google.vr:sdk-base:$vrVersion"
implementation "com.google.vr:sdk-audio:$vrVersion"
implementation "com.google.vr:sdk-common:$vrVersion"
implementation "com.google.vr:sdk-commonwidget:$vrVersion"
implementation "com.google.vr:sdk-panowidget:$vrVersion"
implementation "com.google.vr:sdk-videowidget:$vrVersion"
}
Upvotes: 1
Reputation: 3405
I found resolution to my problem. in order to fix the error, i should add
'com.google.android.exoplayer:exoplayer:r1.5.10'
to Build.gradle (Module: app):
dependencies {
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile project(':gvr-android-sdk/libraries:common')
compile project(':gvr-android-sdk/libraries:commonwidget')
compile project(':gvr-android-sdk/libraries:panowidget')
compile project(':gvr-android-sdk/libraries:videowidget')
compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
}
Upvotes: 0