java - 删除 Android 错误 java.lang.IllegalArgumentException: Service Intent must be explicit: Intent from another class
问题描述
我目前正在开发一个 android 项目,并且一直遇到错误 java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=cn.ingenic.glasssync.SYNC_SERVICE }
我知道较新版本的android需要明确的服务意图,但是它所指的服务意图在导入的类文件SyncModule.java中
private final void bind(IBinder service) {
if (this.mService != null) {
Log.d("SyncModule", "Module:" + this.mName + " already bonded.");
} else {
if (service == null) {
Intent intent = new Intent("cn.ingenic.glasssync.SYNC_SERVICE");
this.mContext.bindService(intent, this.mServiceConnection, 1);
} else {
this.mService = Stub.asInterface(service);
if (this.mService != null) {
try {
this.mService.registModule(this.mName, this.mCallback);
} catch (RemoteException var3) {
Log.e("SyncModule", "", var3);
}
}
}
}
}
它打破的地方是在当地的班级
public SmsModule(String name, Context context) {
super(name, context, true);
它从它的 SyncModule 类调用构造函数,因为这是一个继承的类文件,我无法编辑源代码是否有任何解决方法可以解决此错误?
解决方案
推荐阅读
- ios - 更新 pod 后 FirebaseApp.configure() 崩溃
- spring-boot - 弹簧靴中的可选课程?
- c# - 如何获取选中按钮的内容
- java - Java,使用扫描仪时如何验证输入?
- android - E/SQLiteLog: (1) no such table: Cars on Android 9 Pie
- xcode - 对包含 .app 的 .zip 进行公证和装订的最有效方法是什么?
- iqueryable - Automapper Queryable Extensions 没有出现
- bash - 如何通过 Bash 中的 curl 从谷歌驱动器下载大文件?
- java - Spring Boot 获取 Api 响应:Ebay API
- javascript - 如何根据单击的图像更新内容(Angular)