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

The app crashes when calling Razorpay on Android 14, but it works fine on devices running versions below Android 14. #417

Open
alphawizzflutterteam opened this issue Oct 19, 2024 · 6 comments

Comments

@alphawizzflutterteam
Copy link

Description

com.example/com.razorpay.CheckoutActivity}: java.lang.RuntimeException: java.lang.SecurityException: Writable dex file '/data/user/0/com.example/cache/.    ' is not allowed.

This error indicates that Android 14 enforces stricter security policies, particularly around writable dex files. The Razorpay SDK seems to be attempting to write a dex file to a restricted cache directory, which is not permitted in Android 14 due to its enhanced security measures. To resolve this, updating the Razorpay SDK or modifying how the app handles dex files might be required to comply with Android 14's new security restrictions.

Flutter Version :

3.19.0

Xcode Version :

Xcode 15.4

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

1.click on payment page and call razor pay
2.Crash on razaor pay call

#Crash report

W/com.example( 5057): Accessing hidden field Llibcore/io/Libcore;->os:Llibcore/io/Os; (unsupported, reflection, allowed)
W/com.example( 5057): Accessing hidden method Llibcore/io/ForwardingOs;->setenv(Ljava/lang/String;Ljava/lang/String;Z)V (unsupported, reflection, allowed)
W/com.example( 5057): Accessing hidden method Llibcore/io/ForwardingOs;->getenv(Ljava/lang/String;)Ljava/lang/String; (unsupported, reflection, allowed)
E/com.example( 5057): Attempt to load writable dex file: /data/user/0/com.example/cache/.    
D/CompatibilityChangeReporter( 5057): Compat change id reported: 218865702; UID 10694; state: ENABLED
D/AndroidRuntime( 5057): Shutting down VM
E/AndroidRuntime( 5057): FATAL EXCEPTION: main
E/AndroidRuntime( 5057): Process: com.example, PID: 5057
E/AndroidRuntime( 5057): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example/com.razorpay.CheckoutActivity}: java.lang.RuntimeException: java.lang.SecurityException: Writable dex file '/data/user/0/com.example/cache/.    ' is not allowed.
E/AndroidRuntime( 5057): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3888)
E/AndroidRuntime( 5057): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4028)
E/AndroidRuntime( 5057): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
E/AndroidRuntime( 5057): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139)
E/AndroidRuntime( 5057): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96)
E/AndroidRuntime( 5057): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2535)
E/AndroidRuntime( 5057): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime( 5057): at android.os.Looper.loopOnce(Looper.java:205)
E/AndroidRuntime( 5057): at android.os.Looper.loop(Looper.java:294)
E/AndroidRuntime( 5057): at android.app.ActivityThread.main(ActivityThread.java:8394)
E/AndroidRuntime( 5057): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 5057): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:640)
E/AndroidRuntime( 5057): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)
E/AndroidRuntime( 5057): Caused by: java.lang.RuntimeException: java.lang.SecurityException: Writable dex file '/data/user/0/com.example/cache/.    ' is not allowed.
E/AndroidRuntime( 5057): at com.razorpay.K$$z$.(:393)
E/AndroidRuntime( 5057): at com.razorpay.AnalyticsUtil.reset(:189)
E/AndroidRuntime( 5057): at com.razorpay.BaseUtils.setup(:411)
E/AndroidRuntime( 5057): at com.razorpay.b__J_.onCreate(:82)
E/AndroidRuntime( 5057): at com.razorpay.E$_6$.onCreate(:23)
E/AndroidRuntime( 5057): at com.razorpay.CheckoutActivity.onCreate(:8)
E/AndroidRuntime( 5057): at android.app.Activity.performCreate(Activity.java:8646)
E/AndroidRuntime( 5057): at android.app.Activity.performCreate(Activity.java:8624)
E/AndroidRuntime( 5057): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1456)
E/AndroidRuntime( 5057): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3869)
E/AndroidRuntime( 5057): ... 12 more
E/AndroidRuntime( 5057): Caused by: java.lang.SecurityException: Writable dex file '/data/user/0/com.example/cache/.    ' is not allowed.
E/AndroidRuntime( 5057): at dalvik.system.DexFile.openDexFileNative(Native Method)
E/AndroidRuntime( 5057): at dalvik.system.DexFile.openDexFile(DexFile.java:406)
E/AndroidRuntime( 5057): at dalvik.system.DexFile.(DexFile.java:171)
E/AndroidRuntime( 5057): at dalvik.system.DexFile.loadDex(DexFile.java:231)
E/AndroidRuntime( 5057): at dalvik.system.DexFile.loadDex(DexFile.java:198)
E/AndroidRuntime( 5057): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 5057): at com.razorpay.K$$z$.(:300)
E/AndroidRuntime( 5057): ... 21 more
I/Process ( 5057): Sending signal. PID: 5057 SIG: 9
Lost connection to device.

@vivekshindhe
Copy link
Contributor

@alphawizzflutterteam Unable to reproduce the issue. Is this happening 100% of the time?

@alphawizzflutterteam
Copy link
Author

yes every time when i run in android 14 it is crashing the app.

@alphawizzflutterteam
Copy link
Author

whole app works fine before clicking on the razor pay, after calling razor pay it will be crash.

@alphawizzflutterteam
Copy link
Author

yes every time when i run in android 14 it is crashing the app.

@alphawizzflutterteam
Copy link
Author

Before clicking on Razor Pay the whole app works fine, after calling Razor Pay it will crash. Please give some solution which works.

@alphawizzflutterteam
Copy link
Author

did you find any solution for that same ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants