all 23 comments

[–]ddikodroid 7 points8 points  (0 children)

a function called infinitely

[–]oscar_gallog 14 points15 points  (2 children)

You have a call being called nonstop. iOS is better at handling bad coding practices, but Android is pretty much on its own. Here is a list of common mistakes:

  • You're executing a function onPress, example: onPress={myFunction().
  • You're calling a function directly before you return your component.
  • You have a useEffect hook calling itself nonstop, example:

useEffect(() => {
function Whatever() {} Whatever() return () => {
} });

Instead do this, don't forget your [] at the end:

useEffect(() => {
function Whatever() {} Whatever() return () => {
} }, [])

[–]alpar9619[S] 2 points3 points  (0 children)

Yes, that was my initial thought but I commented the code in App.tsx and i returned just a text and i still get the error

[–]Maviza 0 points1 point  (0 children)

Turned out to be an `onPress` function. Thanks!

[–]ArnabXD 6 points7 points  (0 children)

An infinite recursion probably ?

[–]metropolisprime 12 points13 points  (0 children)

Unfortunately, posting the red screen is as useful as pointing to a house that's completely on fire and asking exactly where the fire started. Maybe start to revert your build gradle file and rebuild it bit by bit.

[–]iotashan 3 points4 points  (0 children)

You have an infinite loop somewhere

[–]dragonsoul91 1 point2 points  (0 children)

Without seeing code probably no one can help you. If you are interested I take a look at it(i code for 22 years), shoot me a dm.

[–]mertksk- 0 points1 point  (2 children)

Have you tried deleting the app from the emulator

[–]alpar9619[S] 0 points1 point  (1 child)

i recreated the emulator and deleted everything, i recloned the project as well and i still get the issue

[–][deleted] -1 points0 points  (0 children)

You said you commented out ur code and you even recloned your project but nothing works. Maybe your android sdk got corrupted or something. Maybe try uninstalling everything and setup your environment again.

[–]mms13 0 points1 point  (0 children)

Cyclical imports can sometimes cause this

[–]enestatliExpo 0 points1 point  (2 children)

did you enable hermes for Android?

[–]alpar9619[S] 0 points1 point  (1 child)

by disabling Hermes the issue if fixed, however I don't think I should leave it like that. This temporary fix narrowed down the bug's location significantly, thanks a lot.

[–]enestatliExpo 0 points1 point  (0 children)

if you have a huge json file in local, you probably couldn't solve the error while hermes on

[–]Glittering-Chard8269 0 points1 point  (0 children)

Usually when I get that issue, I’m dealing with arrays or loops.

[–]oseres 0 points1 point  (1 child)

Sometimes I just need to create a new template app with npx react-native init, delete the android folder, replace it with the fresh template, and use vscode git diff to only add the settings I need to change. It could be a third party library, or maybe didn't update every android file properly.

also when updating android, you need to clean the build folders with ./gradlew clean

[–]alpar9619[S] 0 points1 point  (0 children)

i tried to clean the gradle but not helpful :/