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 ...
142 0
|
9月前
解决 Blocked a frame with origin “xxx“ from accessing a cross-origin frame
解决 Blocked a frame with origin “xxx“ from accessing a cross-origin frame
1266 0
|
4天前
|
Java Spring
Initialization failed for 'https://start.spring.io' Please check URL, network and proxy settings.
Initialization failed for 'https://start.spring.io' Please check URL, network and proxy settings.
352 0
|
5月前
|
JavaScript
Uncaught runtime errors: × ERROR Avoided redundant navigation to current location: “/xxx“.
Uncaught runtime errors: × ERROR Avoided redundant navigation to current location: “/xxx“.
65 0
|
5月前
|
安全 JavaScript 前端开发
No ‘Access-Control-Allow-Origin‘ header is present on the requested resource.
No ‘Access-Control-Allow-Origin‘ header is present on the requested resource.
|
9月前
|
Linux
Specified sample format -1 is invalid or not supported
Specified sample format -1 is invalid or not supported
144 0
Specified sample format -1 is invalid or not supported
|
iOS开发 MacOS
curl: (4) A requested feature, protocol or option was not found
curl: (4) A requested feature, protocol or option was not found
219 0
curl: (4) A requested feature, protocol or option was not found
Failed resolution of: Lokhttp3/internal/Platform;
Failed resolution of: Lokhttp3/internal/Platform;
147 0
Error saving your changes: Description control characters are not allowed
在修改 GitHub 上的仓库描述时出现此提示信息:Error saving your changes: Description control characters are not allowed 开始以为是 Fork 来的没有修改权限,但之前没有遇到这样的情况,提示信息说的也不是这个意思。
2347 0