zoho / salesiq-mobilisten-flutter

SalesIQ Mobilisten plugin for Flutter.
https://mobilisten.io
MIT License
12 stars 10 forks source link

Android Build Fails Due to Deprecated API and Unsafe Operations in R8 build #70

Open mohamedshasho opened 5 days ago

mohamedshasho commented 5 days ago

Hello, I encountered several issues while building my Flutter app using the salesiq_mobilisten library (version 6.3.0):

Deprecated API: Some input files use or override deprecated APIs. Here's the specific file:

MobilistenPlugin.java (path: C:\Users\Dell\AppData\Local\Pub\Cache\hosted\pub.dev\salesiq_mobilisten-6.3.0\android\src\main\java\com\zohosalesiq\plugin\MobilistenPlugin.java)

Build Failure Message:


FAILURE: Build failed with an exception.
ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in E:\work\projects\w-mobile\build\app\outputs\mapping\release\missing_rules.txt.                                                                                                  Chat$Department and 4 other contexts)celize.Parcelize (referenced from: com.zoho.livechat.android.modules.notifications.sdk.entities.SalesIQNotificationPayload$C

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:minifyReleaseWithR8'.
> Compilation failed to complete

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

What was in missing_rules.txt -dontwarn kotlinx.parcelize.Parcelize Gradle:

id "com.android.application" version '8.3.0' apply false
id "org.jetbrains.kotlin.android" version "1.9.10" apply false

Please advise on how to resolve these deprecated API and unsafe operation issues, and any additional steps to fix the R8 build failure. Thank you!

bhahirathan-mb-11956 commented 2 days ago

Hi @mohamedshasho ,

We apologize for the inconvenience. It seems like you have enabled ProGuard(minifyEnabled) R8, so please add the following rules to your pro guard-rules.pro file (Please create a new file if it doesn't exist), which is located in your android folder and the rules are as suggested in the build error.

-dontwarn kotlinx.parcelize.Parcelize

Regards, Bhahirathan M Zoho SalesIQ.