uni-app
uni-app copied to clipboard
AGP8 + minSdk>21会白屏
复现仓库 https://github.com/yzqbugs/UniMPDemo
AGP8.4.1 + minsdk21
,所有的uniapp页面都正常,但是我把minSdk
改为24,26,页面就白屏了
AGP7.4.2 + minsdk26
, 页面也是正常的
根目录的build.gradle
plugins {
id("com.android.application") version "8.4.1" apply false
id("com.android.library") version "8.4.1" apply false
}
app目录的build.gradle
apply plugin: 'com.android.application'
//必须配置
def mfph = [
//包名
"apk.applicationId": "com.example.unimpdemo",
]
android {
compileSdk 33
namespace "com.example.unimpdemo"
defaultConfig {
applicationId "com.example.unimpdemo"
minSdkVersion 26 // uniapp必须是19及以上
targetSdkVersion 33
versionCode 1
versionName "1.0"
multiDexEnabled true
manifestPlaceholders = mfph
ndk {
abiFilters 'x86_64', 'arm64-v8a' //不支持armeabi
}
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
}
}
//此处配置必须添加 否则无法正确运行
aaptOptions {
additionalParameters '--auto-add-overlay'
//noCompress 'foo', 'bar'
ignoreAssetsPattern "!.svn:!.git:.*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
//导入SDK相关依赖jar、aar
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation fileTree(include: ['*.aar'], dir: 'libs')
//必须添加的依赖
implementation "androidx.recyclerview:recyclerview:1.1.0"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation "androidx.appcompat:appcompat:1.1.0"
implementation 'com.alibaba:fastjson:1.2.83'
implementation 'com.facebook.fresco:fresco:2.5.0'
implementation 'com.facebook.fresco:animated-gif:2.5.0'
implementation 'com.facebook.fresco:webpsupport:2.5.0'
implementation 'com.facebook.fresco:animated-webp:2.5.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'com.android.support:multidex:1.0.3'
implementation project(':TestModule')
implementation project(':TestComponent')
implementation 'com.squareup.okhttp3:okhttp:3.7.0'
implementation 'com.squareup.okio:okio:1.8.0'
// add since 2022-12-29
implementation 'androidx.webkit:webkit:1.3.0'
// add since 2023-03-30 微信支付/分享 需要新增配置
implementation 'com.tencent.mm.opensdk:wechat-sdk-android:6.8.0'
implementation 'androidx.core:core-ktx:1.10.0'
}