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

Fix: HostApp is crashing with NoSuchFieldException in staging #149

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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) {
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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 :)

Copy link
Contributor Author

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.

UNKNOWN("unknown"),
Expand All @@ -12,6 +14,7 @@ enum class MiniAppPermissionType(val type: String) {
}

/** Type of miniapp custom permission. **/
@Keep
enum class MiniAppCustomPermissionType(val type: String) {
USER_NAME("rakuten.miniapp.user.USER_NAME"),
PROFILE_PHOTO("rakuten.miniapp.user.PROFILE_PHOTO"),
Expand All @@ -35,6 +38,7 @@ internal enum class MiniAppPermissionResult(val type: String) {
}

/** Type of miniapp custom permission result. **/
@Keep
enum class MiniAppCustomPermissionResult {
ALLOWED,
DENIED,
Expand Down