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

Runtime android app crash #1713

Closed
RakeshPatil111 opened this issue Apr 3, 2024 · 6 comments
Closed

Runtime android app crash #1713

RakeshPatil111 opened this issue Apr 3, 2024 · 6 comments
Labels

Comments

@RakeshPatil111
Copy link

How frequently does the bug occur?

Always

Description

IllegalStateException: Incomplete hierarchy for class RealmObject, unresolved classes [io.realm.kotlin.types.TypedRealmObject]
Getting exception, when creating configuration.
Defined entity classes as follow
class Sample: RealmObject, Entity {}
Entity is custom class having two attributes.

Stacktrace & log output

Non-fatal Exception: java.lang.IllegalStateException: Incomplete hierarchy for class RealmObject, unresolved classes [io.realm.kotlin.types.TypedRealmObject]
       at kotlin.reflect.jvm.internal.impl.descriptors.runtime.components.RuntimeErrorReporter.reportIncompleteHierarchy(RuntimeErrorReporter.java:26)
       at kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedClassDescriptor$DeserializedClassTypeConstructor.computeSupertypes(DeserializedClassDescriptor.kt:245)
       at kotlin.reflect.jvm.internal.impl.types.AbstractTypeConstructor$supertypes$1.invoke(AbstractTypeConstructor.kt:78)
       at kotlin.reflect.jvm.internal.impl.types.AbstractTypeConstructor$supertypes$1.invoke(AbstractTypeConstructor.kt:77)
       at kotlin.reflect.jvm.internal.impl.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
       at kotlin.reflect.jvm.internal.impl.storage.LockBasedStorageManager$LockBasedLazyValueWithPostCompute.invoke(LockBasedStorageManager.java:481)
       at kotlin.reflect.jvm.internal.impl.storage.LockBasedStorageManager$LockBasedNotNullLazyValueWithPostCompute.invoke(LockBasedStorageManager.java:512)
       at kotlin.reflect.jvm.internal.impl.types.AbstractTypeConstructor.getSupertypes(AbstractTypeConstructor.kt:27)
       at kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedClassDescriptor$DeserializedClassMemberScope.getNonDeclaredVariableNames(DeserializedClassDescriptor.kt:355)
       at kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$OptimizedImplementation$variableNames$2.invoke(DeserializedMemberScope.kt:262)
       at kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$OptimizedImplementation$variableNames$2.invoke(DeserializedMemberScope.kt:261)
       at kotlin.reflect.jvm.internal.impl.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
       at kotlin.reflect.jvm.internal.impl.storage.LockBasedStorageManager$LockBasedNotNullLazyValue.invoke(LockBasedStorageManager.java:527)
       at kotlin.reflect.jvm.internal.impl.storage.StorageKt.getValue(Storage.kt:42)
       at kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$OptimizedImplementation.getVariableNames(DeserializedMemberScope.kt:261)
       at kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope.getVariableNames(DeserializedMemberScope.kt:60)
       at kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedClassDescriptor$DeserializedClassMemberScope.getNonDeclaredVariableNames(DeserializedClassDescriptor.kt:356)
       at kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$OptimizedImplementation$variableNames$2.invoke(DeserializedMemberScope.kt:262)
       at kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$OptimizedImplementation$variableNames$2.invoke(DeserializedMemberScope.kt:261)
       at kotlin.reflect.jvm.internal.impl.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
       at kotlin.reflect.jvm.internal.impl.storage.LockBasedStorageManager$LockBasedNotNullLazyValue.invoke(LockBasedStorageManager.java:527)
       at kotlin.reflect.jvm.internal.impl.storage.StorageKt.getValue(Storage.kt:42)
       at kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$OptimizedImplementation.getVariableNames(DeserializedMemberScope.kt:261)
       at kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$OptimizedImplementation.addFunctionsAndPropertiesTo(DeserializedMemberScope.kt:349)
       at kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope.computeDescriptors(DeserializedMemberScope.kt:115)
       at kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedClassDescriptor$DeserializedClassMemberScope$allDescriptors$1.invoke(DeserializedClassDescriptor.kt:274)
       at kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedClassDescriptor$DeserializedClassMemberScope$allDescriptors$1.invoke(DeserializedClassDescriptor.kt:273)
       at kotlin.reflect.jvm.internal.impl.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
       at kotlin.reflect.jvm.internal.impl.storage.LockBasedStorageManager$LockBasedNotNullLazyValue.invoke(LockBasedStorageManager.java:527)
       at kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedClassDescriptor$DeserializedClassMemberScope.getContributedDescriptors(DeserializedClassDescriptor.kt:284)
       at kotlin.reflect.jvm.internal.impl.resolve.scopes.InnerClassesScopeWrapper.getContributedDescriptors(InnerClassesScopeWrapper.kt:35)
       at kotlin.reflect.jvm.internal.impl.resolve.scopes.InnerClassesScopeWrapper.getContributedDescriptors(InnerClassesScopeWrapper.kt:27)
       at kotlin.reflect.jvm.internal.impl.resolve.scopes.ResolutionScope$DefaultImpls.getContributedDescriptors$default(ResolutionScope.kt:50)
       at kotlin.reflect.jvm.internal.KClassImpl$Data$nestedClasses$2.invoke(KClassImpl.kt:100)
       at kotlin.reflect.jvm.internal.KClassImpl$Data$nestedClasses$2.invoke(KClassImpl.kt:99)
       at kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:93)
       at kotlin.reflect.jvm.internal.ReflectProperties$Val.getValue(ReflectProperties.java:32)
       at kotlin.reflect.jvm.internal.KClassImpl$Data.getNestedClasses(KClassImpl.java:99)
       at kotlin.reflect.jvm.internal.KClassImpl.getNestedClasses(KClassImpl.kt:240)
       at kotlin.reflect.full.KClasses.getCompanionObject(KClasses.kt:47)
       at kotlin.reflect.full.KClasses.getCompanionObjectInstance(KClasses.kt:57)
       at io.realm.kotlin.internal.platform.RealmObjectKt.realmObjectCompanionOrNull(RealmObject.kt:27)

Can you reproduce the bug?

Always

Reproduction Steps

Use kotlin realm in KMM code, create native android build and test on PlayStore build.

Version

1.14.0

What Atlas App Services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

Android 14

Build environment

No response

Copy link

sync-by-unito bot commented Apr 3, 2024

➤ PM Bot commented:

Jira ticket: RKOTLIN-1064

@kneth
Copy link
Contributor

kneth commented Apr 4, 2024

My guess is that your ProGuard configuration is missing something. Please provide a full reproduction case for us to help you further.

@sync-by-unito sync-by-unito bot added More-information-needed More information needed from the reporter. The issue will autoclose if no more information is given. Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Apr 4, 2024
@RakeshPatil111
Copy link
Author

My guess is that your ProGuard configuration is missing something. Please provide a full reproduction case for us to help you further.

HI Thanks for the input, can you provide expected proguard configuration?
Searched related to this but did not find anything.
I am using kotlin-realm 1.14.1, Android debug builds works perfectly but release build is throwing exception.

@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed More-information-needed More information needed from the reporter. The issue will autoclose if no more information is given. Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Apr 5, 2024
@kneth
Copy link
Contributor

kneth commented Apr 12, 2024

Without a reproduction case - or at least your proguard configuration - it is difficult to provide a good answer.

@sync-by-unito sync-by-unito bot added Waiting-For-Reporter Waiting for more information from the reporter before we can proceed and removed Needs-Attention Reporter has responded. Review comment. labels Apr 12, 2024
@RakeshPatil111
Copy link
Author

RakeshPatil111 commented Apr 12, 2024

I did not add any proguard configuration for project.
The way I am using realm in project is different.
I have KMM project, which uses realm-kotlin sdk, android native code uses realm-java sdk, this may be causing the issue. Both SDKs are pointing to the same realm file.

@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Apr 12, 2024
@rorbech
Copy link
Contributor

rorbech commented Apr 19, 2024

It is a bit unclear what you mean by "android native code uses realm-java sdk", but have tried to elaborate a bit on the constraints of using both SDKs at the same time.

We don't support open a realm file with both SDKs at the same time. It is also dangerous to access the same realm file with different SDKs even if you don't try to do it simultaneous, as the two SDKs might be using core versions with different file formats.

When you are trying to combine two SDKs in the same app you have to be carefull to specify the model so that you don't get the Kotlin compiler plugin applied on the Java classes. This should be doable following the pattern of defining models from our Java-compatibility example.

@sync-by-unito sync-by-unito bot added Waiting-For-Reporter Waiting for more information from the reporter before we can proceed and removed Needs-Attention Reporter has responded. Review comment. labels Apr 22, 2024
@nirinchev nirinchev closed this as not planned Won't fix, can't repro, duplicate, stale Aug 3, 2024
@sync-by-unito sync-by-unito bot closed this as completed Aug 3, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants