androidx.appcompat.widget.AppCompatEditText.setBackgroundDrawable AppCompatEditText.java, line 175
Description
An error that was never encountered in the development stage. Found in user app crash report after Google Store distribution. I dont know how or when it happens. I have confirmed that a similar issue is still open and has not been fixed. Related task: https://github.com/facebook/react-native/issues/32265
React Native Version
0.70.6
Output of npx react-native info
System: OS: macOS 13.1 CPU: (10) arm64 Apple M1 Pro Memory: 78.48 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node Yarn: 1.22.17 - /opt/homebrew/bin/yarn npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm Watchman: 2022.11.14.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1 Android SDK: Not Found IDEs: Android Studio: 2022.1 AI-221.6008.13.2211.9514443 Xcode: 14.2/14C18 - /usr/bin/xcodebuild Languages: Java: 17.0.1 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: 0.70.6 => 0.70.6 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
I cannot reproduce this. I haven't experienced this. I can only see in logs that it happens for some users, but they haven't reported in on how.
Snack, code example, screenshot, or link to a repository
android.graphics.drawable.DrawableContainer$DrawableContainerState.createAllFutures DrawableContainer.java:879
android.graphics.drawable.DrawableContainer$DrawableContainerState.getOpacity DrawableContainer.java:1162
android.graphics.drawable.DrawableContainer.getOpacity DrawableContainer.java:433
android.graphics.drawable.InsetDrawable.getOpacity InsetDrawable.java:260
android.view.View.computeOpaqueFlags View.java:19140
android.view.View.setBackgroundDrawable View.java:24441
androidx.appcompat.widget.AppCompatEditText.setBackgroundDrawable AppCompatEditText.java:175
android.view.View.setBackground View.java:24334
androidx.appcompat.widget.AppCompatEditText.
| :warning: | Newer Version of React Native is Available! |
|---|---|
| :information_source: | You are on a supported minor version, but it looks like there's a newer patch available. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |
Can you provide the full stacktrace? The one you provided is truncated
Can you provide the full stacktrace? The one you provided is truncated
Of course sorry for that!
android.graphics.drawable.DrawableContainer$DrawableContainerState.createAllFutures DrawableContainer.java:879
android.graphics.drawable.DrawableContainer$DrawableContainerState.getOpacity DrawableContainer.java:1162
android.graphics.drawable.DrawableContainer.getOpacity DrawableContainer.java:433
android.graphics.drawable.InsetDrawable.getOpacity InsetDrawable.java:260
android.view.View.computeOpaqueFlags View.java:19140
android.view.View.setBackgroundDrawable View.java:24441
androidx.appcompat.widget.AppCompatEditText.setBackgroundDrawable AppCompatEditText.java:175
android.view.View.setBackground View.java:24334
android.view.View.<init> View.java:6067
android.widget.TextView.<init> TextView.java:1054
android.widget.EditText.<init> EditText.java:87
android.widget.EditText.<init> EditText.java:83
androidx.appcompat.widget.AppCompatEditText.<init> AppCompatEditText.java:96
androidx.appcompat.widget.AppCompatEditText.<init> AppCompatEditText.java:91
androidx.appcompat.widget.AppCompatEditText.<init> AppCompatEditText.java:87
com.facebook.react.views.textinput.ReactEditText.<init> ReactEditText.java:126
com.facebook.react.views.textinput.ReactTextInputManager.createViewInstance ReactTextInputManager.java:180
com.facebook.react.views.textinput.ReactTextInputManager.createViewInstance ReactTextInputManager.java:81
com.facebook.react.uimanager.ViewManager.createViewInstance ViewManager.java:183
com.facebook.react.uimanager.ViewManager.createView ViewManager.java:115
com.facebook.react.uimanager.NativeViewHierarchyManager.createView NativeViewHierarchyManager.java:281
com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute UIViewOperationQueue.java:194
com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations UIViewOperationQueue.java:1110
com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded UIViewOperationQueue.java:1081
com.facebook.react.uimanager.GuardedFrameCallback.doFrame GuardedFrameCallback.java:29
com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame ReactChoreographer.java:175
com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame ChoreographerCompat.java:85
android.view.Choreographer$CallbackRecord.run Choreographer.java:1240
android.view.Choreographer.doCallbacks Choreographer.java:996
android.view.ChoreographerExtImpl.checkScrollOptSceneEnable ChoreographerExtImpl.java:374
android.view.Choreographer.doFrame Choreographer.java:865
android.view.Choreographer$FrameDisplayEventReceiver.run Choreographer.java:1227
android.os.Handler.handleCallback Handler.java:938
android.os.Handler.dispatchMessage Handler.java:99
android.os.Looper.loopOnce Looper.java:233
android.os.Looper.loop Looper.java:344
android.app.ActivityThread.main ActivityThread.java:8248
java.lang.reflect.Method.invoke Method.java
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run RuntimeInit.java:589
com.android.internal.os.ZygoteInit.main ZygoteInit.java:1071
Of course sorry for that!
This is still truncated (the type of the exception should be visible on top)
Of course sorry for that!
This is still truncated (the type of the exception should be visible on top)
Hmm sorry. Did you mean this?
androidx.appcompat.widget.AppCompatEditText.setBackgroundDrawable
AppCompatEditText.java, line 175
java.lang.NullPointerException: Attempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)' on a null object reference
Hi @cortinico
A complete stack trace of the crash is available.
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)' on a null object reference
at android.graphics.drawable.DrawableContainer$DrawableContainerState.createAllFutures(DrawableContainer.java:875)
at android.graphics.drawable.DrawableContainer$DrawableContainerState.getOpacity(DrawableContainer.java:1158)
at android.graphics.drawable.DrawableContainer.getOpacity(DrawableContainer.java:433)
at android.graphics.drawable.InsetDrawable.getOpacity(InsetDrawable.java:258)
at android.view.View.computeOpaqueFlags(View.java:15698)
at android.view.View.setBackgroundDrawable(View.java:20502)
at androidx.appcompat.widget.AppCompatEditText.setBackgroundDrawable(AppCompatEditText.java:175)
at android.view.View.setBackground(View.java:20395)
at android.view.View.<init>(View.java:5238)
at android.widget.TextView.<init>(TextView.java:843)
at android.widget.EditText.<init>(EditText.java:88)
at android.widget.EditText.<init>(EditText.java:84)
at androidx.appcompat.widget.AppCompatEditText.<init>(AppCompatEditText.java:96)
at androidx.appcompat.widget.AppCompatEditText.<init>(AppCompatEditText.java:91)
at androidx.appcompat.widget.AppCompatEditText.<init>(AppCompatEditText.java:87)
at com.facebook.react.views.textinput.ReactEditText.<init>(ReactEditText.java:126)
at com.facebook.react.views.textinput.ReactTextInputManager.createViewInstance(ReactTextInputManager.java:180)
at com.facebook.react.views.textinput.ReactTextInputManager.createViewInstance(ReactTextInputManager.java:81)
at com.facebook.react.uimanager.ViewManager.createViewInstance(ViewManager.java:183)
at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:115)
at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:281)
at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:194)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations(UIViewOperationQueue.java:1110)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1081)
at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:909)
at android.view.Choreographer.doCallbacks(Choreographer.java:723)
at android.view.Choreographer.doFrame(Choreographer.java:655)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:463)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
This error did not occur in the development environment It is only found in user app crash reports after Google Store distribution.
Unable to find a root cause for this issue.
I'm unable to tell from the stacktrace what's happening sorry. Can we create a reproducer?
| :warning: | Missing Reproducible Example |
|---|---|
| :information_source: | It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner. |
This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.
Closing as no reproducer got provided