-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hongmeng (HarmonyOS) crashes during registration #726
Comments
我的鸿蒙也出现了 Caused by: java.lang.ClassNotFoundException: Didn't find class "android.window.BackEvent" on path: DexPathList |
There are multiple issues about this, do none of the solutions there work? |
Thank you for your replay. YES, I don't find any solution to fix this bug in the ISSUES. THE error message is: Didn't find class "android.window.BackEvent". There is no same issues. WHAT information about this bug do you want, I can offer? My CODE as follow: class JourneyFinishActivity : FlutterActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (!EventBus.getDefault().isRegistered(this) && findBackEvent()) {
EventBus.getDefault().register(this)
}
} Especially, invoke the I hope this is helpful and I look forward to hearing from you. Good luck. |
Please look at the issues I have linked. They are relevant to your issue which is a |
增加一个冗余类 临时解决 Translation: Add a redundant class as a temporary solution class _SplashFlutterActivityEventReceiver(val activity: SplashFlutterActivity) {
fun register() {
if (!EventBus.getDefault().isRegistered(this)) {
EventBus.getDefault().register(this)
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
fun onFlutterEvent(event: FlutterSendEventBean) {
...
}
fun unRegister() {
if (EventBus.getDefault().isRegistered(this)) {
EventBus.getDefault().unregister(this)
}
}
}
open class SplashFlutterActivity : FlutterBoostActivity() {
val _eventReceiver = _SplashFlutterActivityEventReceiver(this)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
_eventReceiver.register()
...
}
override fun onDestroy() {
super.onDestroy()
_eventReceiver.unRegister()
...
} |
I had the same crash in my Flutter activity and temporarily fixed it with @mainlxl 's logic. |
methods里面有个是空的报错 在flutterActivity内用EventBus Translation: There is an empty error in methods. Use EventBus in flutterActivity. |
this android lib. |
Edit: updated to translate to English, as this issue tracker is in English.
鸿蒙系统注册时崩溃
Translation: Hongmeng system crashes during registration
崩溃执行的代码为
EventBus.getDefault().register(this)
在注册的时候就崩溃了。崩溃的日志如下:Translation: The code executed by the crash is
EventBus.getDefault().register(this)
and it crashes when registering. The crash log is as follows:The text was updated successfully, but these errors were encountered: