react-native-art / art

React Native module that allows you to draw vector graphics.
https://github.com/react-native-community/art
MIT License
287 stars 78 forks source link

App Crashing on Android Version 8.0.0 & Version 8.1.0 #93

Open SachinA94 opened 3 years ago

SachinA94 commented 3 years ago

Description

Recently getting lots of crash report from my users that their app is suddenly crashing while using. I tried multiple solutions, but nothing is solving this issue. These crashes are only happening on Oreo devices only.

React Native version:

System: OS: macOS 11.3.1 CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz Memory: 81.34 MB / 8.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.1.0 - /usr/local/bin/node Yarn: Not Found npm: 7.11.2 - /usr/local/bin/npm Watchman: Not Found Managers: CocoaPods: 1.10.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4 Android SDK: API Levels: 23, 28, 29, 30 Build Tools: 28.0.3, 29.0.2, 30.0.3 System Images: android-22 | Google APIs Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: 4.2 AI-202.7660.26.42.7351085 Xcode: 12.5/12E262 - /usr/bin/xcodebuild Languages: Java: 1.8.0_292 - /usr/bin/javac Python: 2.7.16 - /usr/bin/python npmPackages: @react-native-community/cli: Not Found react: 16.13.1 => 16.13.1 react-native: 0.63.3 => 0.63.3 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Firebase Crashlytics error log

Fatal Exception: java.lang.RuntimeException Unable to resume activity {/.MainActivity}: android.view.Surface$OutOfResourcesException android.app.ActivityThread.performResumeActivity

Fatal Exception: java.lang.RuntimeException: Unable to resume activity {/.MainActivity}: android.view.Surface$OutOfResourcesException at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3741) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3781) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1749) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:192) at android.app.ActivityThread.main(ActivityThread.java:6748) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:875)

Caused by android.view.Surface$OutOfResourcesException at android.view.Surface.nativeLockCanvas(Surface.java) at android.view.Surface.lockCanvas(Surface.java:337) at com.reactnativecommunity.art.e.b(:14) at com.reactnativecommunity.art.e.onHostResume(:1) at com.facebook.react.bridge.ReactContext.onHostResume(:34) at com.facebook.react.r.E(:23) at com.facebook.react.r.L(:39) at com.facebook.react.r.M(:5) at com.facebook.react.q.j(:29) at com.facebook.react.n.t(:2) at com.facebook.react.m.onResume(:5) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1360) at android.app.Activity.performResume(Activity.java:7249) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3716) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3781) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1749) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:192) at android.app.ActivityThread.main(ActivityThread.java:6748) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:875

SachinA94 commented 3 years ago

I figured it out there is a drawOutput method in file ARTSurfaceViewShadowNode behind this issue. To temp. resolve, i putted a check to stop call drawOutput method on Oreo devices. If anyone knows, how to get rid of these crashes, please share.