Skip to content
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

Fix runtime crash caused by java.lang.ClassNotFoundException #25101

Merged
merged 1 commit into from
Feb 16, 2023
Merged

Fix runtime crash caused by java.lang.ClassNotFoundException #25101

merged 1 commit into from
Feb 16, 2023

Conversation

yufengwangca
Copy link
Contributor

@yufengwangca yufengwangca commented Feb 16, 2023

Currently, package android.util is implemented as stub functions on x86, the java-matter-controller crashes when run into any of stub functions during run-time

[Dynamic-linking native method java.lang.Throwable.fillInStackTrace ... JNI]
Exception in thread "main" java.lang.NoClassDefFoundError: android/util/Log
[Dynamic-linking native method java.lang.StackTraceElement.initStackTraceElements ... JNI]
	at chip.devicecontroller.ChipDeviceController.<init>(ChipDeviceController.java:58)
	at com.matter.controller.Main.main(Main.java:105)
Caused by: java.lang.ClassNotFoundException: android.util.Log
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)

Implement the missing part of Log functions to just print the log message to console, we could latter improve these functions with java.util.logging.Logger

@github-actions
Copy link

PR #25101: Size comparison from 83dd188 to 3a1c884

Full report (1 build for cc32xx)
platform target config section 83dd188 3a1c884 change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 641857 641857 0 0.0
(read/write) 204124 204124 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197528 197528 0 0.0
.comment 194 194 0 0.0
.data 1476 1476 0 0.0
.debug_abbrev 931515 931515 0 0.0
.debug_aranges 87432 87432 0 0.0
.debug_frame 300120 300120 0 0.0
.debug_info 20338085 20338085 0 0.0
.debug_line 2657824 2657824 0 0.0
.debug_loc 2790649 2790649 0 0.0
.debug_ranges 281568 281568 0 0.0
.debug_str 3003658 3003658 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 105697 105697 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 376514 376514 0 0.0
.symtab 256016 256016 0 0.0
.text 534036 534036 0 0.0

@andy31415 andy31415 merged commit 3f99254 into project-chip:master Feb 16, 2023
@yufengwangca yufengwangca deleted the pr/java/log branch February 16, 2023 16:19
lecndav pushed a commit to lecndav/connectedhomeip that referenced this pull request Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants