Failed resolution of: Landroidx/localbroadcastmanager/content/LocalBroadcastManager

简介: Failed resolution of: Landroidx/localbroadcastmanager/content/LocalBroadcastManager

集成android mqtt的时候报错:


java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/localbroadcastmanager/content/LocalBroadcastManager;


在谷歌官网找到这个类被废弃了,应该是mqtt源码实现使用了这个类,导致找不到类而报错,解决方案是:在build.gradle里添加依赖:


implementation 'com.android.support:support-v4:30.4.1'


其中30:是指你的编译版本,这个操作应该是,v4兼容包里有LocalBroadcastManager。


    implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.1.0'
    implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'
    implementation 'com.android.support:support-v4:30.4.1'


目录
相关文章
|
缓存 PHP
Composer 报错 Error while processing content unencoding: Unknown failure within ...
Composer 报错 Error while processing content unencoding: Unknown failure within ...
229 0
|
算法 C# C++
HALCON error #1201: Wrong type of control parameter: 1 in operator threshold
HALCON error #1201: Wrong type of control parameter: 1 in operator threshold
|
7月前
|
存储 缓存 自然语言处理
“error“: { “root_cause“: [{ “type“: “circuit_breaking_exception“, “reason“: “[parent] D【已解决】
“error“: { “root_cause“: [{ “type“: “circuit_breaking_exception“, “reason“: “[parent] D【已解决】
57 1
|
8月前
|
前端开发
Google Earth Engine(GEE)——argument ‘input‘: Invalid type. Expected type: Image<unknown bands>错误
Google Earth Engine(GEE)——argument ‘input‘: Invalid type. Expected type: Image<unknown bands>错误
87 0
|
JavaScript
Uncaught runtime errors: × ERROR Avoided redundant navigation to current location: “/xxx“.
Uncaught runtime errors: × ERROR Avoided redundant navigation to current location: “/xxx“.
217 0
|
编解码 定位技术
Google Earth Engine——Error: Image.clipToBoundsAndScale, argument ‘input‘: Invalid type的错误解决
Google Earth Engine——Error: Image.clipToBoundsAndScale, argument ‘input‘: Invalid type的错误解决
334 0
Google Earth Engine——Error: Image.clipToBoundsAndScale, argument ‘input‘: Invalid type的错误解决
Dx unsupported class file version 52.0 Conversion to Dalvik format failed with error 1
Dx unsupported class file version 52.0 Conversion to Dalvik format failed with error 1
162 0
|
计算机视觉
opencv出错:error: (-213:The function/feature is not implemented) Unknown/unsupported array type
opencv出错:error: (-213:The function/feature is not implemented) Unknown/unsupported array type
491 0
|
应用服务中间件 Android开发
a configuration error occurred during startup. place verify the preference field whth the prompt:TomcatJDK name:
a configuration error occurred during startup. place verify the preference field whth the prompt:TomcatJDK name:
147 0
a configuration error occurred during startup. place verify the preference field whth the prompt:TomcatJDK name:
|
C语言
[Error] ‘for‘ loop initial declarations are only allowed in C99 mode
[Error] ‘for‘ loop initial declarations are only allowed in C99 mode
340 0
[Error] ‘for‘ loop initial declarations are only allowed in C99 mode