android - SERVICE_MISSING/SERVICE_DISABLED 错误 - react-native-youtube
问题描述
我正在尝试使用该react-native-youtube
包在我的应用程序中显示 youtube 视频。当我尝试将 youtube 视频呈现到屏幕上时,我收到以下弹出窗口:
github README 说明了这一点:
重要的!(仅限 Android):此组件的 Android 实现需要在设备上安装官方 YouTube 应用程序。否则将提示用户安装/激活应用程序,并使用 SERVICE_MISSING/SERVICE_DISABLED 触发错误事件。
首先,我确信最新版本的 YouTube 应用程序已安装在我的模拟器上。需要注意的是,我在真正的 Amazon Fire Stick 上尝试了这个并且遇到了同样的问题。此链接说明 Android 11 要求您在AndroidManifest.xml
要引用的包中指明。我已经尝试了那里的所有建议,但没有成功。
这是我目前的AndroidManifest.xml
:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.digitalsignageplayer">
<uses-permission android:name="android.permission.INTERNET" />
<uses-feature android:name="android.hardware.screen.portrait" android:required="false"/>
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
我的编译和目标 SDK:
ext {
buildToolsVersion = "29.0.3"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 29
ndkVersion = "20.1.5948944"
}
解决方案
推荐阅读
- pine-script - 如何在 PINE Editor 中停止生成多个买入信号
- javascript - 问题当前值未显示滑块范围 html/javascript
- microservices - Nestjs 基于事件的消息传递,具有 1 个生产者和 2 个消费者
- python - 变量范围:无法在 for 循环内打印
- typescript - 有没有办法将 json 文件转换为 Deno 中的对象模型?
- node.js - 监视 MongoDB 以返回更改以及指定的字段值,而不是返回 fullDocument
- php - 在 laravel 中出现“未定义的变量:类别”错误
- reactjs - 当用户按下返回按钮时删除一些页面
- node.js - 使用 Redis 平衡算法方法
- javascript - 将旧 js 项目覆盖到 webpack npm 得到错误,例如无法读取 null 的属性“className”