2016-11-23 11 views
2

我得到的錯誤,而使用Google VR我在使用VR android.view.InflateException得到錯誤:二進制XML文件行#44:錯誤充氣類com.google.vr.sdk.widgets.video.VrVideoView

由於this error

android.view.InflateException: Binary XML file line #44: Error inflating class com.google.vr.sdk.widgets.video.VrVideoView 

這是我的佈局:

<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> 

這是我的build.gradle(模塊: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' 
} 

它是失敗的()onCreateView的第一線法

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

它失敗的所有虛擬設備和真實設備。

有什麼問題?

感謝您的幫助。

回答

0

我找到解決我的問題。 以修復錯誤,我要補充

'com.google.android.exoplayer:exoplayer:r1.5.10' 

到的build.gradle(模塊: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' 

}

相關問題