uniapp 项目打包时提示未添加videoplayer模块
1. uniapp 项目打包时提示未添加videoplayer模块
(1)uniapp项目,遇到视频提示打包时未添加videoplayer模块。
(2)如果是云打包只需在manifest.json,模块权限配置中勾选即可。
官方文档:https://ask.dcloud.net.cn/article/283
(3)如果是使用Android离线打包则需要把 media-release.aar,weex_videoplayer-release.aar 这两个文件复制到项目的libs目录下(文件可以在原始工程找到,如果找不到则需要下载新版。官方下载链接:https://nativesupport.dcloud.net.cn/AppDocs/download/android.html#)
(4)然后需要在dcloud_properties.xml中添加如下代码,应该就可以正常使用了
<feature name="VideoPlayer" value="io.dcloud.media.MediaFeatureImpl"/>
(5)我在添加之后报错,因为视频依赖最小兼容的minSdk版本是19,而我的minSdk版本是17。
Manifest merger failed : uses-sdk:minSdkVersion 17 cannot be smaller than version 19 declared in library [media-release.aar] C:\Users\Administrator\.gradle\caches\transforms-1\files-1.1\jetified-media-release.aar\11877467e774a43d4ed248249d13918e\AndroidManifest.xml as the library might be using APIs not available in 17Suggestion: use a compatible library with a minSdk of at most 17,or increase this project's minSdk version to at least 19,or use tools:overrideLibrary="io.dcloud.feature.media" to force usage (may lead to runtime failures)
(6)在build.gradle修改minSdkVersion后解决。
(7)附上app离线打包官方链接:https://nativesupport.dcloud.net.cn/AppDocs/usemodule/androidModuleConfig/others.html#videoplayer%EF%BC%88%E8%A7%86%E9%A2%91%E6%92%AD%E6%94%BE%EF%BC%89