5***@qq.com
5***@qq.com
  • 发布:2025-03-14 17:38
  • 更新:2025-03-14 18:26
  • 阅读:81

【报Bug】开发工具升级后APP打包失败

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

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

HBuilderX类型: 正式

HBuilderX版本号: 4.56

手机系统: Android

手机系统版本号: Android 14

手机厂商: 三星

手机机型: 三星

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:

直接云端打包

预期结果:

正常打包

实际结果:
错误解决方案

错误描述: uts插件编译失败
解决方案: 请根据编译错误修改插件相关代码后重新提交打包。或联系插件作者解决。
######################

e: file://[PackagePath]/wgtRoot/UNIF90BE95/uni_modules/ts-amap/utssdk/app-android/src/index.kt:610:12 Type mismatch: inferred type is Boolean but Unit was expected

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':uni_modules:ts-amap:compileReleaseKotlin'.

    A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
    Compilation error. See log for more details

  • Try:

    Run with --stacktrace option to get the stack trace.
    Run with --info or --debug option to get more log output.
    Run with --scan to get full insights.
    Get more help at https://help.gradle.org.

BUILD FAILED in 21s
Error code = -5000
Error message:
UTS plugin @ utssdk ts-amap compile error!

bug描述:

HBuilderX升级到最新版本4.56
云端打包和本地运行都uts插件的错误

2025-03-14 17:38 负责人:无 分享
已邀请:
DCloud_heavensoft

DCloud_heavensoft

插件地址发一下,优先联系插件作者解决。

  • 5***@qq.com (作者)

    自己写的,就调用的

    UTSAndroid.checkSystemPermissionGranted(UTSAndroid.getUniActivity()!, permission)

    报错:error: 类型不匹配: 推断类型是Boolean,但预期的是Unit。

    官方文档这个方法不是返回的Boolean?


    没升级前都是正常的。

    2025-03-14 17:49

  • DCloud_App_Array

    回复 5***@qq.com: 报错原因是 UTSAndroid.checkSystemPermissionGranted返回的是boolean,外部封装的checkLocationPermission没有声明返回值类型为boolean,默认是void(对应android平台的Unit)。

    2025-03-14 18:57

5***@qq.com

5***@qq.com (作者)

开发工具回退版本到4.45,可以正常运行。

DCloud_heavensoft

DCloud_heavensoft

插件地址发一下,或者给重现工程

要回复问题请先登录注册