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: HostApp is crashing with NoSuchFieldException in staging #149
Fix: HostApp is crashing with NoSuchFieldException in staging #149
Conversation
Codecov Report
@@ Coverage Diff @@
## master #149 +/- ##
=======================================
Coverage 89.58% 89.58%
=======================================
Files 33 33
Lines 768 768
Branches 68 68
=======================================
Hits 688 688
Misses 55 55
Partials 25 25
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can fix it by putting @Keep
in enum class. Those enum classes are in MiniAppPermission.kt
. You should check the data class of MiniAppCustomPermission
too.
@@ -1,5 +1,7 @@ | |||
package com.rakuten.tech.mobile.miniapp.permission | |||
|
|||
import androidx.annotation.Keep | |||
|
|||
/** Type of miniapp permission. **/ | |||
enum class MiniAppPermissionType(val type: String) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this one also need @Keep
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, there is no affect has been traced for this class without @Keep
. But for safety we can address it here, what do you think @minh-rakuten?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@khairul-alam-licon I guess just putting @Keep
on data class MiniAppCustomPermission
will help you fix the problem, no need to update @Keep
for enum in MiniAppPermission.kt
. I'm not sure so let try it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@minh-rakuten I understand your concern, as MiniAppCustomPermission
has a pairValues
. Here, I re-checked that, adding @Keep
annotation only in MiniAppCustomPermissionType
and MiniAppCustomPermissionResult
helps actually. So, I updated this PR. For now, let's keep it to understand clearly where we require this annotation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍
Thanks guys for the reviews 👍 |
Description
HostApp is crashing in
staging
with following exception when requesting custom permission e.g.USER_NAME
This is not happening in
debug
. After reading few issues e.g. google/gson#1776 and google/gson#924, I have come out with two solutions:minifyEnabled false
in here as the staging buildTypes takes some favors fromrelease
.-keepclassmembers enum * { *; }
inminiapp/proguard-rules.pro
@Keep
annotation as @minh-rakuten suggested.Links
MINI-1690
Checklist
./gradlew check
without errors