8***@qq.com
8***@qq.com
  • 发布:2023-09-01 10:40
  • 更新:2023-09-01 10:40
  • 阅读:168

【报Bug】安卓离线打包 添加VideoPlayer模块arr文件 apk安装运行后白屏

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10

HBuilderX类型: 正式

HBuilderX版本号: 3.8.12

手机系统: Android

手机系统版本号: Android 12

手机厂商: 模拟器

手机机型: mumu

页面类型: vue

vue版本: vue2

打包方式: 离线

项目创建方式: HBuilderX

示例代码:

build.gradle文件

plugins {  
    id 'com.android.application'  
}  

android {  
    namespace 'com.example.mdl_kv'  
    compileSdk 33  

    defaultConfig {  
        applicationId "com.example.mdl_kv"  
        minSdk 24  
        targetSdk 33  
        versionCode 1  
        versionName "1.0"  
        multiDexEnabled true  

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"  
    }  
    signingConfigs {  
        config {  
            keyAlias 'mdl-kv'  
            keyPassword 'xzj19970423'  
            storeFile file('a869be7667ee4ac78bba147ddd242943.keystore')  
            storePassword 'xzj19970423'  
            v1SigningEnabled true  
            v2SigningEnabled true  
        }  
    }  

    buildTypes {  
        debug {  
            signingConfig signingConfigs.config  
        }  
        release {  
            minifyEnabled false  
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'  
            signingConfig signingConfigs.config  
        }  
    }  
    compileOptions {  
        sourceCompatibility JavaVersion.VERSION_1_8  
        targetCompatibility JavaVersion.VERSION_1_8  
    }  
    aaptOptions {  
        additionalParameters '--auto-add-overlay'  
        ignoreAssetsPattern "!.svn:!.git:.*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~"  
    }  
}  

dependencies {  

    implementation 'androidx.appcompat:appcompat:1.6.1'  
    implementation 'com.google.android.material:material:1.8.0'  
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'  
    testImplementation 'junit:junit:4.13.2'  
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'  
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'  

    implementation fileTree(include: ['*.jar'], dir: 'libs')  
    implementation fileTree(include: ['*.aar'], dir: 'libs')  
    implementation 'androidx.appcompat:appcompat:1.0.0'  
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'  
    implementation 'androidx.recyclerview:recyclerview:1.0.0'  
    implementation 'com.facebook.fresco:fresco:2.5.0'  
    implementation "com.facebook.fresco:animated-gif:2.5.0"  
    implementation 'com.github.bumptech.glide:glide:4.9.0'  
    implementation 'com.alibaba:fastjson:1.2.83'  
    implementation 'androidx.webkit:webkit:1.3.0'  
}

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>  
<manifest xmlns:android="http://schemas.android.com/apk/res/android"  
    xmlns:tools="http://schemas.android.com/tools">  

    <application  
        android:allowBackup="true"  
        android:dataExtractionRules="@xml/data_extraction_rules"  
        android:fullBackupContent="@xml/backup_rules"  
        android:icon="@drawable/icon"  
        android:label="@string/mdl_kv"  
        android:roundIcon="@mipmap/ic_launcher_round"  
        android:supportsRtl="true"  
        android:theme="@style/Theme.Mdl_kv"  
        tools:targetApi="31">  
        <activity  
            android:name="io.dcloud.PandoraEntry"  
            android:configChanges="orientation|keyboardHidden|keyboard|navigation"  
            android:label="@string/mdl_kv"  
            android:launchMode="singleTask"  
            android:hardwareAccelerated="true"  
            android:theme="@style/TranslucentTheme"  
            android:screenOrientation="user"  
            android:windowSoftInputMode="adjustResize"  
            android:exported="true">  
            <intent-filter>  
                <action android:name="android.intent.action.MAIN" />  
                <category android:name="android.intent.category.LAUNCHER" />  
            </intent-filter>  
            <intent-filter>  
                <category android:name="android.intent.category.DEFAULT" />  
                <category android:name="android.intent.category.BROWSABLE" />  
                <action android:name="android.intent.action.VIEW" />  
                <data android:scheme=" " />  
            </intent-filter>  
        </activity>  
        <activity  
            android:name="io.dcloud.PandoraEntryActivity"  
            android:launchMode="singleTask"  
            android:configChanges="orientation|keyboardHidden|screenSize|mcc|mnc|fontScale|keyboard|smallestScreenSize|screenLayout|screenSize|uiMode"  
            android:hardwareAccelerated="true"  
            android:permission="com.miui.securitycenter.permission.AppPermissionsEditor"  
            android:screenOrientation="user"  
            android:theme="@style/DCloudTheme"  
            android:windowSoftInputMode="adjustResize"  
            android:exported="true">  
        </activity>  
        <meta-data  
            android:name="dcloud_appkey"  
            android:value="08265c39bb895a797582905014d434f8" />  
        <meta-data  
            android:name="DCLOUD_DARK_MODE"  
            android:value= "auto" />  
    </application>  

</manifest>

操作步骤:

将3.8.12版本 weex_videoplayer-release.aar media-release.aar放入libs下打包apk

预期结果:

安装apk后 正常运行

实际结果:

安装apk后 运行白屏

bug描述:

我在libs下添加了 weex_videoplayer-release.aar media-release.aar 文件
并且 dcloud_properties.xml 中也添加了

 <feature name="VideoPlayer" value="io.dcloud.media.MediaFeatureImpl"/>

成功打包apk后 启动应用 白屏

如果去掉 weex_videoplayer-release.aar media-release.aar 文件 打包apk后运行成功
请问这是什么原因导致的

我使用的Android 离线SDK版本是 3.8.12

2023-09-01 10:40 负责人:无 分享
已邀请:

要回复问题请先登录注册