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

🐛 Bug Report: Crash after minify enabled #63

Open
2 tasks done
buddy-dev-1337 opened this issue Dec 13, 2024 · 1 comment
Open
2 tasks done

🐛 Bug Report: Crash after minify enabled #63

buddy-dev-1337 opened this issue Dec 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@buddy-dev-1337
Copy link

buddy-dev-1337 commented Dec 13, 2024

👟 Reproduction steps

When I enable minify and run the app it crashes and below is the exception

Fatal Exception: kotlin.reflect.jvm.internal.KotlinReflectionInternalError: Function 'listDocuments' (JVM signature: listDocuments(Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/lang/Class;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;) not resolved in class io.appwrite.services.Databases:
public final suspend fun <T> listDocuments(databaseId: kotlin.String, collectionId: kotlin.String, queries: kotlin.collections.List<kotlin.String>? = ..., nestedType: java.lang.Class<T>): io.appwrite.models.DocumentList<T> defined in io.appwrite.services.Databases | listDocuments(Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/lang/Class;Lla/d;)Ljava/lang/Object;
public final suspend fun listDocuments(databaseId: kotlin.String, collectionId: kotlin.String, queries: kotlin.collections.List<kotlin.String>? = ...): io.appwrite.models.DocumentList<kotlin.collections.Map<kotlin.String, kotlin.Any>> defined in io.appwrite.services.Databases | listDocuments(Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Lla/d;)Ljava/lang/Object;
       at kotlin.reflect.jvm.internal.KDeclarationContainerImpl.findFunctionDescriptor(KDeclarationContainerImpl.kt:146)
       at kotlin.reflect.jvm.internal.KFunctionImpl$descriptor$2.invoke(KFunctionImpl.kt:2)
       at kotlin.reflect.jvm.internal.KFunctionImpl$descriptor$2.invoke(KFunctionImpl.kt:1)
       at kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:17)
       at kotlin.reflect.jvm.internal.ReflectProperties$Val.getValue(ReflectProperties.java)
       at kotlin.reflect.jvm.internal.KFunctionImpl.getDescriptor(KFunctionImpl.kt:2)
       at kotlin.reflect.jvm.internal.KFunctionImpl.getDescriptor(KFunctionImpl.kt:1)
       at kotlin.reflect.jvm.internal.KCallableImpl$_typeParameters$1.invoke(KCallableImpl.kt:2)
       at kotlin.reflect.jvm.internal.KCallableImpl$_typeParameters$1.invoke(KCallableImpl.kt:1)
       at kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:17)
       at kotlin.reflect.jvm.internal.KCallableImpl.getTypeParameters(KCallableImpl.kt:2)
       at kotlin.jvm.internal.CallableReference.getTypeParameters(CallableReference.java:4)
       at kotlin.reflect.jvm.internal.ReflectionFactoryImpl.typeParameter(ReflectionFactoryImpl.java:20)
       at kotlin.jvm.internal.Reflection.typeParameter(Reflection.java:6)
       at io.appwrite.services.Databases.listDocuments(Databases.kt:6)
       at io.appwrite.services.Databases.listDocuments(Databases.kt:18)
       at live.buddy.GenderActivity$initUI$3$1.invokeSuspend(GenderActivity.kt:109)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:9)
       at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:125)
       at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.java:101)
       at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:101)
       at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(BuildersKt__Builders_common.kt:36)
       at kotlinx.coroutines.BuildersKt.launch(Builders.kt:36)
       at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(BuildersKt__Builders_common.kt:36)
       at kotlinx.coroutines.BuildersKt.launch$default(Builders.kt:36)
       at live.buddy.GenderActivity.initUI$lambda$3(GenderActivity.java:23)
       at android.view.View.performClick(View.java:7931)
       at android.view.View.performClickInternal(View.java:7908)
       at android.view.View.-$$Nest$mperformClickInternal()
       at android.view.View$PerformClick.run(View.java:30990)
       at android.os.Handler.handleCallback(Handler.java:959)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at android.os.Looper.loopOnce(Looper.java:232)
       at android.os.Looper.loop(Looper.java:317)
       at android.app.ActivityThread.main(ActivityThread.java:8592)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)

my pro-guard rules

-dontwarn io.getstream.video.android.mock.StreamPreviewDataUtilsKt

# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * extends com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer
# Prevent R8 from leaving Data object members always null
-keepclasseswithmembers class * {
    <init>(...);
    @com.google.gson.annotations.SerializedName <fields>;
}
# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
-keep class kotlin.reflect.jvm.internal.**
-keep class kotlin.Metadata { *; }
-keep class io.appwrite.** { *; }
-keepclassmembers class kotlin.Metadata {
    public <methods>;
}
-keepclassmembers class * {
    @kotlin.reflect.jvm.* *;
}

-keep class io.appwrite.services.Databases { *; }
-keep class io.appwrite.models.DocumentList { *; }
-keepclassmembers class io.appwrite.services.Databases {
    public *** listDocuments(...);
}

👍 Expected behavior

Should not crash the app

👎 Actual Behavior

Crashes the app when app is minified for release build

🎲 Appwrite version

Appwrite Cloud

💻 Operating system

MacOS

🧱 Your Environment

I'm using io.appwrite:sdk-for-android:6.0.0

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@buddy-dev-1337 buddy-dev-1337 added the bug Something isn't working label Dec 13, 2024
@buddy-dev-1337
Copy link
Author

buddy-dev-1337 commented Jan 7, 2025

Upgraded to 6.1.0 but the crash persists.

It happens every time I try to update the DB

databases.updateDocument( databaseId = databaseID, collectionId = usersCollectionID, documentId = userId, data = mapOf( "name" to name, "value" to value))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant