I have converted the code with the help of HMS toolkit to support both GMS and HMS. but after the conversion, it crashes and throws exception.
Process: com.example.android.wander.huawei, PID: 10649 java.lang.VerifyError: Verifier rejected class com.example.android.wander.huawei.MapsActivity: void com.example.android.wander.huawei.MapsActivity.onCreate(android.os.Bundle) failed to verify: void com.example.android.wander.huawei.MapsActivity.onCreate(android.os.Bundle): [0x11] 'this' argument 'Reference: androidx.fragment.app.FragmentManager' not instance of 'Reference: androidx.fragment.app.FragmentManager' (declaration of 'com.example.android.wander.huawei.MapsActivity' appears in /data/app/~~M8blTtc1ehsAE-ySiPYUtQ==/com.example.android.wander.huawei-0H3LEYclNRMAw9Pq-MrWww==/base.apk) at java.lang.Class.newInstance(Native Method) at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95) at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45) at android.app.Instrumentation.newActivity(Instrumentation.java:1253) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3353) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85) 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:2066) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7656) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
after i removed the line from application class.
XLoader.init(this);
this exception went away and then
SupportMapFragment.newInstance()
throws runtimeexception 'stub'