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'


目录
相关文章
|
9月前
|
编解码 数据处理
|
缓存 PHP
Composer 报错 Error while processing content unencoding: Unknown failure within ...
Composer 报错 Error while processing content unencoding: Unknown failure within ...
242 0
|
8月前
|
存储 缓存 自然语言处理
“error“: { “root_cause“: [{ “type“: “circuit_breaking_exception“, “reason“: “[parent] D【已解决】
“error“: { “root_cause“: [{ “type“: “circuit_breaking_exception“, “reason“: “[parent] D【已解决】
62 1
|
9月前
|
前端开发
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>错误
101 0
|
JavaScript
Uncaught runtime errors: × ERROR Avoided redundant navigation to current location: “/xxx“.
Uncaught runtime errors: × ERROR Avoided redundant navigation to current location: “/xxx“.
234 0
|
编解码 定位技术
Google Earth Engine——Error: Image.clipToBoundsAndScale, argument ‘input‘: Invalid type的错误解决
Google Earth Engine——Error: Image.clipToBoundsAndScale, argument ‘input‘: Invalid type的错误解决
344 0
Google Earth Engine——Error: Image.clipToBoundsAndScale, argument ‘input‘: Invalid type的错误解决
|
编解码
configure: error: You requested G729 audio codec but not found...die
configure: error: You requested G729 audio codec but not found...die
96 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
500 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:
151 0
a configuration error occurred during startup. place verify the preference field whth the prompt:TomcatJDK name:
Failed resolution of: Lokhttp3/internal/Platform;
Failed resolution of: Lokhttp3/internal/Platform;
185 0