-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Issue in release mode #214
Comments
After more investigation, it seems to be related to moshi package, kotlinx package is working fine. Also the stacktrace looks like: kotlin.reflect.jvm.internal.KotlinReflectionInternalError: This callable does not support a default call: public constructor MoshiEmoji(@com.squareup.moshi.Json aliases: kotlin.collections.List<kotlin.String>? = ..., @com.squareup.moshi.Json description: kotlin.String? = ..., @com.squareup.moshi.Json emoji: kotlin.String, @com.squareup.moshi.Json emojiChar: kotlin.String, @com.squareup.moshi.Json supportsFitzpatrick: kotlin.Boolean = ..., @com.squareup.moshi.Json supportsGender: kotlin.Boolean = ..., @com.squareup.moshi.Json tags: kotlin.collections.List<kotlin.String>? = ...) defined in io.wax911.emojify.serializer.moshi.MoshiEmoji[DeserializedClassConstructorDescriptor@4bda7bf]
at kotlin.reflect.jvm.internal.KCallableImpl.callDefaultMethod$kotlin_reflection(KCallableImpl.kt:192)
at kotlin.reflect.jvm.internal.KCallableImpl.callBy(KCallableImpl.kt:111)
at com.squareup.moshi.kotlin.reflect.KotlinJsonAdapter.fromJson(KotlinJsonAdapter.kt:118)
at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
at com.squareup.moshi.CollectionJsonAdapter.fromJson(CollectionJsonAdapter.java:81)
at com.squareup.moshi.CollectionJsonAdapter$2.fromJson(CollectionJsonAdapter.java:55)
at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
at com.squareup.moshi.JsonAdapter.fromJson(JsonAdapter.java:58)
at io.wax911.emojify.serializer.moshi.MoshiDeserializer.decodeFromStream(MoshiDeserializer.kt:36)
at io.wax911.emojify.EmojiManager$Companion.initEmojiData(EmojiManager.kt:160)
at io.wax911.emojify.EmojiManager$Companion.initEmojiData$default(EmojiManager.kt:154)
at io.wax911.emojify.EmojiManager$Companion.create(EmojiManager.kt:177)
at app.biiscuit.emojifyreleasevariantissue.MainActivity.onCreate(MainActivity.kt:15)
at android.app.Activity.performCreate(Activity.java:7802)
at android.app.Activity.performCreate(Activity.java:7791)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) |
Oh okay, it seems that Maybe something like in the proguard-rules.pro would solve the issue
|
Definately, was about to ask what your pro-guard rules were. Ideally all the serializer modules need proguard rules and we should be able to ship artifacts with default rules by using |
The working proguard rules are -keep class io.wax911.emojify.serializer.moshi.MoshiEmoji { *;}
-dontwarn com.google.gson.Gson
-dontwarn com.google.gson.annotations.SerializedName
-dontwarn com.google.gson.reflect.TypeToken
-keep class io.wax911.emojify.serializer.gson.GsonEmoji { *;} I also ran into a bug with Gson which has issue deserializing lazy value Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object kotlin.Lazy.getValue()' on a null object reference
at io.wax911.emojify.contract.model.AbstractEmoji.getUnicode(AbstractEmoji.kt:26)
at io.wax911.emojify.parser.EmojiParserKt.parseToUnicode(EmojiParser.kt:139)
at app.biiscuit.emojifyreleasevariantissue.MainActivity.onCreate(MainActivity.kt:16)
at android.app.Activity.performCreate(Activity.java:6662)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599) I'm not sure how to solve this as AbstractEmoji is abstract and doesn't know about Gson details |
What if you override the fields in the implementing class and annotate them to mark them as |
I'll be able to test this end of next week to tell you but this could work yes |
I finally had some time to check it out, adding a consumer-rules.pro on moshi module fixed the issue. |
I see, that's indeed unfortunate. I intend to create a workflow action to fetch the latest emoji spec and generate the |
Yep doing the conversion in the script would avoid unnecessary computing when serializing |
Yes please, feel free to push any issue you find 😃 |
Description of Bug
Hello just found an issue when
isMinifyEnabled = true
. The issue seems to be at the EmojiManager creation, for some reason the json doesn't get decoded. I have created a repo to showcase https://github.com/yoobi/emojifyreleaseissueReproduction Steps
Start the app mode when
isMinifyEnabled = true
and the text just shows:sweat_smile:
instead of the real emojiThe text was updated successfully, but these errors were encountered: