因 androidx.work:work-runtime 版本过低导致的闪退

问题

今天在 BlackBox 盒子启动应用,在 Android13 上,启动使用 agp7 打出包又遇到了应用启动之后出现闪退,记录一下吧!

NewBlackbox

黑盒BlackBox,是一款虚拟引擎,可以在Android上克隆、运行虚拟应用,拥有免安装运行能力。黑盒可以掌控被运行的虚拟应用,做任何想做的事情。

在这里插入图片描述

在此之前我的应用 androidx.work:work-runtime:2.1.0 -> 2.7.0 版本是 2.1.0,升级到 2.7.0 问题不再复现了。

在这里插入图片描述

解决

    //fix: argeting S+ (version " + Build.VERSION_CODES.S
    //370                      + " and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE"
    //371                      + " be specified when creating a PendingIntent.\nStrongly consider"
    //372                      + " using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality"
    //373                      + " depends on the PendingIntent being mutable, e.g. if it needs to"
    //374                      + " be used with inline replies or bubbles.
    // 2.7.0   2.8.0
    configurations.all{
        resolutionStrategy.force 'androidx.work:work-runtime:2.7.0'
    }
[versions] activity = "1.9.1" coil-compose-version = "2.0.0-rc03" core-ktx = "1.13.0" google-gson = "2.9.1" junit = "4.13.2" kotlinx-coroutines-android = "1.6.2" lifecycle = "2.8.7" okhttp = "4.10.0" ktor-version = "2.0.3" androidx-test-ext-junit = "1.2.1" espresso-core = "3.6.1" appcompat = "1.7.0" material = "1.12.0" quickie-bundled = "1.10.0" savedstate = "1.2.1" mlkit-text = "16.0.1" junit-ktx = "1.2.1" mlkit-common-version = "18.11.0" agp = "8.9.1" kotlin = "2.1.10" ksp = "2.1.10-1.0.30" [libraries] # androidx core-ktx = { module = "androidx.core:core-ktx", version.ref = "core-ktx" } androidx-viewpager2 = "androidx.viewpager2:viewpager2:1.1.0" androidx-work = "androidx.work:work-runtime:2.9.1" androidx-swiperefreshlayout = "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0" androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version = "2.2.0" } androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version.ref = "activity" } androidx-webkit = "androidx.webkit:webkit:1.12.1" documentfile = "androidx.documentfile:documentfile:1.0.1" androidx-savedstate = { module = "androidx.savedstate:savedstate", version.ref = "savedstate" } androidx-savedstate-ktx = { module = "androidx.savedstate:savedstate-ktx", version.ref = "savedstate" } preference-ktx = "androidx.preference:preference-ktx:1.2.1" androidx-annotation = "androidx.annotation:annotation:1.9.1" activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activity" } appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } # material ====================================== material = { group = "com.google.android.material", name = "material", version.ref = "material" } compose-material3 = "androidx.compose.material3:material3:1.3.1" compose-material3-window-size = "androidx.compose.material3:material3-window-size-class:1.3.1" compose-material3-adaptive-navigation-suite = "androidx.compose.material3:material3-adaptive-navigation-suite:1.3.1" #lifecycle lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle" } lifecycle-livedata-ktx = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "lifecycle" } lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime", version.ref = "lifecycle" } lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "lifecycle" } lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycle" } lifecycle-viewmodel-savedstate = { module = "androidx.lifecycle:lifecycle-viewmodel-savedstate", version.ref = "lifecycle" } lifecycle-compiler = { module = "androidx.lifecycle:lifecycle-compiler", version.ref = "lifecycle" } lifecycle-service = { module = "androidx.lifecycle:lifecycle-service", version.ref = "lifecycle" } # androidx compose compose-bom = "androidx.compose:compose-bom:2025.02.00" compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" } compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4" } compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" } compose-material = { module = "androidx.compose.material:material" } compose-ui = { module = "androidx.compose.ui:ui" } compose-foundation = { module = "androidx.compose.foundation:foundation" } compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout" } compose-animation-core = { module = "androidx.compose.animation:animation-core" } compose-animation = { module = "androidx.compose.animation:animation" } ########################## # rhino mozilla-rhino = "org.mozilla:rhino:1.8.0" mozilla-rhino-xml = "org.mozilla:rhino-xml:1.8.0" mozilla-rhino-tools = "org.mozilla:rhino-tools:1.8.0" # commons commons-exec = "org.apache.commons:commons-exec:1.3" commons-io = "commons-io:commons-io:2.6" kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines-android" } google-gson = { module = "com.google.code.gson:gson", version.ref = "google-gson" } okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" } # ktor ktor-server-core = { module = "io.ktor:ktor-server-core", version.ref = "ktor-version" } ktor-server-netty = { module = "io.ktor:ktor-server-netty", version.ref = "ktor-version" } ktor-server-websockets = { module = "io.ktor:ktor-server-websockets", version.ref = "ktor-version" } ktor-client-websockets = { module = "io.ktor:ktor-client-websockets", version.ref = "ktor-version" } ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor-version" } ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor-version" } # mlkit mlkit-common = { group = "com.google.mlkit", name = "common", version.ref = "mlkit-common-version" } mlkit-text-recognition = { module = "com.google.mlkit:text-recognition", version.ref = "mlkit-text" } mlkit-text-recognition-chinese = { module = "com.google.mlkit:text-recognition-chinese", version.ref = "mlkit-text" } mlkit-text-recognition-devanagari = { module = "com.google.mlkit:text-recognition-devanagari", version.ref = "mlkit-text" } mlkit-text-recognition-japanese = { module = "com.google.mlkit:text-recognition-japanese", version.ref = "mlkit-text" } mlkit-text-recognition-korean = { module = "com.google.mlkit:text-recognition-korean", version.ref = "mlkit-text" } #rxjava quickie-bundled = { module = "io.github.g00fy2.quickie:quickie-bundled", version.ref = "quickie-bundled" } rxjava2 = "io.reactivex.rxjava2:rxjava:2.2.21" rxjava2-rxandroid = "io.reactivex.rxjava2:rxandroid:2.1.1" rxjava3 = "io.reactivex.rxjava3:rxjava:3.1.5" rxjava3-rxandroid = "io.reactivex.rxjava3:rxandroid:3.0.2" javet-android-node = "com.caoccao.javet:javet-android-node:3.1.4" #shizuku shizuku-api = "dev.rikka.shizuku:api:13.1.5" shizuku-provider = "dev.rikka.shizuku:provider:13.1.5" ktsh = "com.jaredrummler:ktsh:1.0.0" #test libraries =================================== junit = { module = "junit:junit", version.ref = "junit" } androidx-junit-ktx = { group = "androidx.test.ext", name = "junit-ktx", version.ref = "junit-ktx" } #leakcanary leakcanary-android = "com.squareup.leakcanary:leakcanary-android:2.13" leakcanary-objectinfo-watcher-android = "com.squareup.leakcanary:leakcanary-object-watcher-android:2.13" retrofit2-retrofit = "com.squareup.retrofit2:retrofit:2.9.0" retrofit2-converter-gson = "com.squareup.retrofit2:converter-gson:2.9.0" test-runner = "androidx.test:runner:1.6.2" test-rules = "androidx.test:rules:1.6.1" androidx-test-ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-ext-junit" } espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso-core" } timscriptov-apksigner = "com.github.TimScriptov:apksigner:1.2.0" coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil-compose-version" } #Deprecated ======================================== #Glide glide = "com.github.bumptech.glide:glide:4.8.0" glide-ksp = "com.github.bumptech.glide:ksp:4.14.2" glide-compiler = "com.github.bumptech.glide:compiler:4.12.0" [plugins] agp-app = { id = "com.android.application", version.ref = "agp" } agp-lib = { id = "com.android.library", version.ref = "agp" } kotlin = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } [bundles] ktor = ["ktor-server-core", "ktor-server-netty", "ktor-server-websockets", "ktor-client-websockets", "ktor-client-okhttp", "ktor-client-core"] mlkit = [ "mlkit-text-recognition", "mlkit-text-recognition-chinese", "mlkit-text-recognition-devanagari", "mlkit-text-recognition-japanese", "mlkit-text-recognition-korean" ] shizuku = ["shizuku-api", "shizuku-provider"] 这个是一个Android Studio 的 libs.versions.toml 文件的代码,请帮我重构,去掉重复的代码,类似于ktsh = "com.jaredrummler:ktsh:1.0.0"这样的代码,修改为 module 或在 group 格式,并且在[versions]中定义版本
最新发布
08-19
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值