java.lang.NullPointerException
See original GitHub issuePlease provide all the information requested. Issues that do not follow this format are likely to stall.
Description
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 (ReactTextInputShadowNode.java:77)
React Native version:
Run react-native info
in your terminal and copy the results here.
System: OS: macOS 11.1 CPU: (8) x64 Intel® Core™ i5-8279U CPU @ 2.40GHz Memory: 19.66 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 10.15.3 - /usr/local/bin/node Yarn: 1.22.10 - /usr/local/bin/yarn npm: 6.4.1 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2 Android SDK: API Levels: 23, 25, 26, 27, 28, 29 Build Tools: 27.0.3, 28.0.3, 29.0.2, 29.0.3, 30.0.2 System Images: android-22 | Google APIs Intel x86 Atom, android-25 | Google Play Intel x86 Atom, android-28 | Android TV Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom IDEs: Android Studio: 4.0 AI-193.6911.18.40.6626763 Xcode: 12.4/12D4e - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.5 => 0.61.5 npmGlobalPackages: react-native-cli: 2.0.1
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
- This was happened randomly. We have tried to reproduce it but can’t find the solution.
- We got this crash via Instabug
- Please find the attachment for more info Crash#207.txt
Expected Results
Describe what you expected to happen.
Snack, code example, screenshot, or link to a repository:
Please provide a Snack (https://snack.expo.io/), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (1 by maintainers)
Top GitHub Comments
It looks like the #17530 issue. This issue was was wrongly closed, because the crash still happens despite the supposed fix and the use of the latest stable version of RN (0.68.2). I write a comment here, because I search an open related issue, before create a new one
I am also facing this issue on react-native 0.68.0 in production. React Native : 0.68 Android: 11, Phone : Realme Narzo 50i.
Steps to Reproduce Render textinputs like this in a view vertically.
`import { View, Text, TextInput, FlatList } from ‘react-native’ import React, { useEffect, useState } from ‘react’
export default function Test() { const [startKey, setStartKey] = useState(0);
}`
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:880) at android.graphics.drawable.DrawableContainer$DrawableContainerState.getOpacity(DrawableContainer.java:1163) at android.graphics.drawable.DrawableContainer.getOpacity(DrawableContainer.java:434) at android.graphics.drawable.InsetDrawable.getOpacity(InsetDrawable.java:259) at android.view.View.computeOpaqueFlags(View.java:18906) at android.view.View.setBackgroundDrawable(View.java:24069) at androidx.appcompat.widget.AppCompatEditText.setBackgroundDrawable(AppCompatEditText.java) at android.view.View.setBackground(View.java:23962) at android.view.View.<init>(View.java:6111) at android.widget.TextView.<init>(TextView.java:1020) at android.widget.EditText.<init>(EditText.java:87) at android.widget.EditText.<init>(EditText.java:83) at androidx.appcompat.widget.AppCompatEditText.<init>(AppCompatEditText.java:4) at androidx.appcompat.widget.AppCompatEditText.<init>(AppCompatEditText.java:2) at androidx.appcompat.widget.AppCompatEditText.<init>(AppCompatEditText.java:1) at com.facebook.react.views.textinput.ReactEditText.<init>(ReactEditText.java) at com.facebook.react.views.textinput.ReactTextInputManager.createViewInstance(ReactTextInputManager.java:2) at com.facebook.react.views.textinput.ReactTextInputManager.createViewInstance(ReactTextInputManager.java) at com.facebook.react.uimanager.ViewManager.createViewInstance(ViewManager.java) at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java) at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:40) at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:23) at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations(UIViewOperationQueue.java:58) at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:23) at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java) at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:46) at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:2) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1159) at android.view.Choreographer.doCallbacks(Choreographer.java:983) at android.view.Choreographer.doFrame(Choreographer.java:904) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1146) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:263) at android.app.ActivityThread.main(ActivityThread.java:8292) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1006)