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'


目录
相关文章
QSoundEffect(qaudio): Error decoding source
QSoundEffect(qaudio): Error decoding source
295 0
|
缓存 PHP
Composer 报错 Error while processing content unencoding: Unknown failure within ...
Composer 报错 Error while processing content unencoding: Unknown failure within ...
212 0
|
5月前
|
存储 缓存 自然语言处理
“error“: { “root_cause“: [{ “type“: “circuit_breaking_exception“, “reason“: “[parent] D【已解决】
“error“: { “root_cause“: [{ “type“: “circuit_breaking_exception“, “reason“: “[parent] D【已解决】
48 1
|
6月前
|
前端开发
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>错误
81 0
|
11月前
|
JavaScript
Uncaught runtime errors: × ERROR Avoided redundant navigation to current location: “/xxx“.
Uncaught runtime errors: × ERROR Avoided redundant navigation to current location: “/xxx“.
175 0
FFmpeg Invalid data found when processing input
FFmpeg Invalid data found when processing input
520 0
|
编解码
configure: error: You requested G729 audio codec but not found...die
configure: error: You requested G729 audio codec but not found...die
84 0
|
C语言
[Error] ‘for‘ loop initial declarations are only allowed in C99 mode
[Error] ‘for‘ loop initial declarations are only allowed in C99 mode
331 0
[Error] ‘for‘ loop initial declarations are only allowed in C99 mode
Failed resolution of: Lokhttp3/internal/Platform;
Failed resolution of: Lokhttp3/internal/Platform;
177 0