我在原生插件里面接入androidx
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.work:work-runtime:2.4.0'
并且在json文件中加入了
{
"plugins": [
{
"type": "module",
"name": "xxxx",
"class": "xxxxxxxx"
}
],
"integrateType": "aar",
"minSdkVersion": "16",
"useAndroidX": true
}
放入uniapp项目中后,报错,报的错误是
No virtual method getNotificationChannel(Ljava/lang/String;)Landroid/app/NotificationChannel; in class Landroidx/core/app/NotificationManagerCompat; or its super classes (declaration of 'androidx.core.app.NotificationManagerCompat' appears in /data/app/uni.UNI069D511-vRIyDE2dMuiiHn9XY_BtwA==/base.apk)
项目中用到了NotificationManagerCompat
- 发布:2021-02-21 08:53
- 更新:2021-02-21 16:34
- 阅读:1965
z***@yeah.net (作者) - shjhlb
云打包的壳没加
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.work:work-runtime:2.4.0'
依赖吧?我试了一天,发现如果壳子只加了
android.useAndroidX=true
android.enableJetifier=true
未对库进行依赖,在运行示例项目的时候会崩溃,壳加上依赖就好了,希望尽快在云打包的壳上加上依赖
DCloud_Android_ST
壳? 如果是缺少依赖库 原生插件package.json配置dependencies 将缺少依赖库配置进去 https://nativesupport.dcloud.net.cn/NativePlugin/course/package?id=dependencies
2021-02-22 10:50
z***@yeah.net (作者)
回复 DCloud_Android_ST: 插件中用到了androidx.work-runtime,放到uniapp项目中,打出来的基座包有问题。我用的插件SDK和HbuildX都是最新的
2021-02-22 15:28
DCloud_Android_ST
package.json的dependencies节点配置'androidx.work:work-runtime:2.4.0'
2021-02-22 16:09
z***@yeah.net (作者)
回复 DCloud_Android_ST: 好的 谢谢,我试试
2021-02-22 16:29
z***@yeah.net (作者)
回复 DCloud_Android_ST: 可以了 谢谢
2021-02-23 08:42