Unchecked errors when build with gradle

There is no compile error or runtime error in my app, and the app run well.
But every time I build it, the following errors come out, seems the generated files of Realm make it.
How can I fix it?
My dependency:
implementation “io.realm:realm-gradle-plugin:10.18.0”
Build Error:

> Task :app:compileDebugJavaWithJavac
ע: Processing class WordIn
ע: Processing class Word
ע: Processing class Record
ע: Creating DefaultRealmModule
D:\Workspace\AndroidStudioProjects\ReciteExtension\app\build\generated\ap_generated_sources\debug\out\io\realm\com_example_re_db_WordInRealmProxy.java:539: ����: [unchecked] ��������δ�������: ���� com_example_re_db_RecordRealmProxy�еķ��� updateEmbeddedObjectӦ�õ�����������
com_example_re_db_RecordRealmProxy.updateEmbeddedObject(realm, recordsUnmanagedItem, linkedObject, new HashMap<RealmModel, RealmObjectProxy>(), Collections.EMPTY_SET);
^
��Ҫ: Realm,Record,Record,Map<RealmModel,RealmObjectProxy>,Set
�ҵ�: Realm,Record,Record,HashMap<RealmModel,RealmObjectProxy>,Set
D:\Workspace\AndroidStudioProjects\ReciteExtension\app\build\generated\ap_generated_sources\debug\out\io\realm\com_example_re_db_WordInRealmProxy.java:539: ����: [unchecked] δ������ת��
com_example_re_db_RecordRealmProxy.updateEmbeddedObject(realm, recordsUnmanagedItem, linkedObject, new HashMap<RealmModel, RealmObjectProxy>(), Collections.EMPTY_SET);
^
��Ҫ: Set
�ҵ�: Set
D:\Workspace\AndroidStudioProjects\ReciteExtension\app\build\generated\ap_generated_sources\debug\out\io\realm\com_example_re_db_WordInRealmProxy.java:838: ����: [unchecked] ��������δ�������: ���� com_example_re_db_RecordRealmProxy�еķ��� updateEmbeddedObjectӦ�õ�����������
com_example_re_db_RecordRealmProxy.updateEmbeddedObject(realm, recordsUnmanagedItem, proxyObject, new HashMap<RealmModel, RealmObjectProxy>(), Collections.EMPTY_SET);
^
��Ҫ: Realm,Record,Record,Map<RealmModel,RealmObjectProxy>,Set
�ҵ�: Realm,Record,Record,HashMap<RealmModel,RealmObjectProxy>,Set
D:\Workspace\AndroidStudioProjects\ReciteExtension\app\build\generated\ap_generated_sources\debug\out\io\realm\com_example_re_db_WordInRealmProxy.java:838: ����: [unchecked] δ������ת��
com_example_re_db_RecordRealmProxy.updateEmbeddedObject(realm, recordsUnmanagedItem, proxyObject, new HashMap<RealmModel, RealmObjectProxy>(), Collections.EMPTY_SET);
^
��Ҫ: Set
�ҵ�: Set
D:\Workspace\AndroidStudioProjects\ReciteExtension\app\build\generated\ap_generated_sources\debug\out\io\realm\DefaultRealmModuleMediator.java:78: ����: [unchecked] DefaultRealmModuleMediator�е�getClazzImpl(String)������RealmProxyMediator�е�getClazzImpl(String)
public Class<? extends RealmModel> getClazzImpl(String className) {
^
����������Ҫ��Class<? extends RealmModel>��Class��δ������ת��
����, T�����ͱ���:
T��չ���ڷ��� getClazzImpl(String)��������RealmModel
5 ������

1 Like

Any updates on this?

I think I have a similar issue, but can’t find any solutions to this.
My build warning is:
app\build\generated\ap_generated_sources\debug\out\io\realm\DefaultRealmModuleMediator.java:470: Warning: [unchecked] getClazzImpl(String) in DefaultRealmModuleMediator overrides getClazzImpl(String) in RealmProxyMediator
public Class<? extends RealmModel> getClazzImpl(String className) {
^
Return type requires an unchecked conversion from Class<? extends RealmModel> to Class
T is a type variable:
T extends RealmModel, declared in method getClazzImpl(String)

Translated with DeepL.com (free version)