2

I installed react-native and created a new project using the command npx react-native init AwesomeProject (I have not added any code) and when I run the project using npx react-native run-android I get an error Task :app:processDebugResources FAILED

After using --warning-mode all I now get the following feedback:

IncrementalTaskInputs has been deprecated. This is scheduled to be removed in Gradle 8.0. On method 'IncrementalTask.taskAction$gradle_core' use 'org.gradle.work.InputChanges' instead. Consult the upgrading guide for further information: https://docs.gradle.org/7.5.1/userguide/upgrading_version_7.html#incremental_task_inputs_deprecation at react_umo8btiw38k009lp8jdme1yz$_run_closure8$_closure10$_closure13.doCall(C:\Windows\System32\AwesomeProject\node_modules\react-native\react.gradle:395) (Run with --stacktrace to get the full stack trace of this deprecation warning.)

How can I fix this? I wasted hours trying to fix it. I just want to to code a bit but I'm instead stuck at this..

JDK version: 11.0.16.1

Gradle version: 7.5.1

Ali Dhan
  • 21
  • 3
  • Please provide enough code so others can better understand or reproduce the problem. – Community Oct 20 '22 at 08:20
  • Though there isn't enough details, but I too faced a similar issue. I opened the android project in android studio and tried running from there. There it gave me another error which is mentioned in this thread. https://stackoverflow.com/questions/67448034/module-was-compiled-with-an-incompatible-version-of-kotlin-the-binary-version – pcsaunak Oct 21 '22 at 07:59
  • i have same error' any solution? – Haim Abeles Oct 23 '22 at 17:58
  • @HaimAbeles Yeah, check answers below. – Ali Dhan Oct 26 '22 at 09:43

3 Answers3

1

I got similar warning log(s), but first of all, my answer is only for future readers;
(Because OP did have complete separete issue than what he asked for.)


I was sure my own build-script did NOT use IncrementalTaskInputs anywhere.

Hence, I first tried update to newer Gradle-wrapper, without expected result.

Like ./gradlew wrapper --gradle-version 7.5.1

Finally, seems IncrementalTaskInputs is used by Kotlin, hence updating that should get rid of the said warning and/or future-error (as the warning says, it will throw error in future).

But an additional problem is, Kotlin version bundled with my dependencies conflicts silently, causing strange Runtime-crashes and/or errors.
Meaning, we can not update Kotlin until the day each our dependency does update as well.

Top-Master
  • 7,611
  • 5
  • 39
  • 71
0

Okay problem solved. I initially created the project in the directory my command prompt defaults to which is "C:\windows\system32". This seems to have caused the problem (probably it has something to do with permissions).

Once I used a different directory and created the same project it worked without issues.

Ali Dhan
  • 21
  • 3
  • Not really the right solution; OP even now has that build-warning, just not build-errors, but he will get a nice build error once he updates to Gradle 8.0 ;-) – Top-Master Nov 10 '22 at 18:59
0

After installing new react-native app and your app is not launching, follow the below steps.

Note: Ensure you have minimum of 5GB space on your HDD.

  1. Close both “Metro Server” and “Android Emulator”.
  2. Launch “Android Studio”, navigaete to “Device Manager”, then “Wipe Data” of the android device installed.
  3. Click on “Cold Boot Now” from the installed device in Android Studio, and wait for the device to finish booting.
  4. cd android && ./gradlew clean & cd ..
  5. npx react-native run-android