-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Attempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)' on a null object reference #2924
Comments
@vitorqshr can you please run a test with the master version? we just merged #2924 (cc: @mikehardy ) |
If you are using react-native less than 0.60 my patch isn’t necessary I don’t think. If (big IF! not sure this problem is AndroidX-related) this is an AndroidX problem with react-native 0.59.x or lower, you would see it if your app was androidX already, and you had not run If this wasn’t an AndroidX app then I’m not sure it would show up? I suppose issue templates in modules need to be updated to include a question if the app is AndroidX or not |
@christopherdro just published 0.25.0 on npm, would be great to give it a shot and report back |
I found a solution. Not sure if it's a long term one, but this will let you guys work until a permanent solution is found. |
I have the same propblem. i tried to all these methods not worked for me help!!!!! |
@Jega1 (sorry for my English) just try to type in the terminal react-native run-android instead of react-native start... that worked for me |
I guess solved this error. So I'm using react-native version 0.61 My impression are; I tested it on more than one real device. I loop without using components like flatlist or recyclerlist. (I think react keeps these components in the cache and provides performance for the next refresh.) I get this error when I fetch and loop data multiple times. It doesn't happen the first time because RAM is fresh. When I started testing on different devices with high hardware capabilities, I realized that I had to fetch more data to get this error. I have almost 4GB ram in the emulator (HAXM) I've fetched the data for 5 minutes yet I haven't encountered this error. The tests I made using flatlist without going to 3rd party were very successful. You can try switching to any flatlist or 3rd party listing method. First, do not forget to convert your data to the component. I must remind you; Even if a react-native bridge is performing, we should make sure that our code has permons. Enjoy coding. |
@Mitra98t @fatihmert thanks a lot. |
I just had the same EXACT problem and errors. Clear the data and cache on your expo app on your phone, then it should work |
clear app cache from the physical device works for me. |
I was getting the same problem with expo .. stopped running the app , cleared expo recently open project and again started with ' expo start ' ... This worked for me.. |
Just kill all node process and start npm server and run application |
For expo, this happened to me when I clear data and cache of my Expo. Just restart your expo run 'epxo start -c' |
What about when your tracking detects this happening in production? |
@nolife08021 |
i kinda still looking for this, just incase |
The same error here, fix after clear cache on the phone |
I have the same persistent problem. It is possible to clean the cache from the app? |
@vicaster have you found any solution? |
@Shahzaib1999 nop 😭 |
Summary: This fixes TextInput measurement caching. Previously we were not setting the correct Spannable in the cache; we needed to additional Spans to it to indicate font size and other attributes. This brings Fabric closer to how non-Fabric was measuring Spannables for TextInputs (see ReactTextInputShadowNode.java). This should fix a few crashes and will be most noticeable with dynamically-sized multiline textinputs where the number of lines changes over time. This also allows us to transmit less data from C++ to Java in the majority of cases. Changelog: [Internal] Differential Revision: D23670779 fbshipit-source-id: cf9b8c848b9e0c2619e01766b72b074248466825
Funcionou para mim. Obrigado |
Same problem here. No solution yet?? |
@eldano1995 nop. May be the 0.64 version will resolve it. i saw a commit which talk about resolve textInput bug. |
why this bug is closed ?!!! |
this is an active bug |
Clear the cache from expo project. |
Hi I have recently face same crash with my production build. I have check my Firebase Crashlytics and found it occurred after user input some text and press the submit button. DEVICE INFO Dependencies
|
facing the same issue .. can anyone help? |
Any fix? |
To resolve this problem i was created my own , it's a custom keyboard. Waiting for react native's staff resolve this problem..... |
My bad. It seems that the fix is on its way to release: facebook/react-native@254493e
|
That one is actually more of a workaround than a fix, you may apply it at any time, I see it in the upgrade-helper diffs for upgrades to react-native 0.67-rc series, and you can take it from there - it's only referencing things that you apply directly not any internal react-native code: https://react-native-community.github.io/upgrade-helper/?from=0.66.1&to=0.67.0-rc.2 |
Debes borrar el cache de tu celular a mi me funciono :) |
any solution ? |
|
same issue on oneplus with 0.64.1 |
Any updates? |
Adding my bug report to this thread. Using React Native 0.64.2, with Expo, running the app in development is fine. The build for Google Play is another matter. |
What's more this bug is so rare that I cant do more debug.. Its occurs also in production. |
I had the same problem; but i solved it by deleting data from my |
Same problem on expo. It doesn't matter for me while developing but if it will cause a problem in production this is a problem :/ |
wipe your virtual device data reset cache and restart simulator |
The same issue, occurs when using TextInput. RN version 0.69.5 |
Issue still exists in RN 0.70.0. |
Still getting this error. Happens when using TextInput. Any workaround yet? |
The REMEDY ..for android Log out of the app. |
Add the flowing line of code into /android/app/src/main/res/values/styles.xml. |
Just Clean the cache witch this folownig command: yarn start -c OR npx expo start -c |
This worked for me Thanks!! |
Thanks for solution but I am facing issue after applying above code,textinputs ignoring css. And Attempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)' on a null object reference facing issue on live app(Crashes and ANRs). |
The problem is that those fixes just work for developing mode, doesn't work for production apps. |
Same issue with the following env:
|
When it works, it works. Resetting worked fine for me. 👍 |
Bug
App breaking when entering the screen
Environment info
Samsuns Galaxy S8
react-native : 0.59.8
react-native-maps : 0.24.0 to 0.24.2 (tried both)
React native info output:
Reproducible sample code
...
this.state = {
region: {
latitude: 37.78825,
longitude: -122.4324,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
}
}
.....
<MapView
ref={map => this.mapView = map}
initialRegion={this.state.region}
region={this.state.region}
rotateEnabled={false}
scrollEnabled={false}
zoomEnabled={false}
showsPointsOfInterest={false}
showsBuildings={false}
showsUserLocation={true}
loadingEnabled={true}
/>
The text was updated successfully, but these errors were encountered: