gpt4 book ai didi

java - 我在使用 VR android.view.InflateException : Binary XML file line #44: Error inflating class com. google.vr.sdk.widgets.video.VrVideoView 时出错

转载 作者:行者123 更新时间:2023-12-05 06:41:19 31 4
gpt4 key购买 nike

我在使用 Google VR 时出错

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

它在所有虚拟设备和真实设备上都失败了。

有什么问题?

感谢您的帮助。

最佳答案

我也有同样的问题。通过在 Build.gradle 上移动到 like 来解决

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

关于java - 我在使用 VR android.view.InflateException : Binary XML file line #44: Error inflating class com. google.vr.sdk.widgets.video.VrVideoView 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40759540/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com