0

i am trying to create a react native project i have 2 android devices 1 is running android 9 and 1 is running android 12 my app is getting is installing and running on device that has android 9 but my app is not running on android 12

i get the following error

> Task :app:installDebug
Installing APK 'app-debug.apk' on '2201117PI - 12' for :app:debug

> Task :app:installDebug FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.


enter image description here

enter image description here

vivek kn
  • 107
  • 1
  • 18
  • 45
  • try ./gradlew -stop and rebuild project ref from -: https://github.com/facebook/react-native/issues/33488 – Ragnar Nov 25 '22 at 06:14
  • accoding to that document i run the commad inside android folder i get this error `'.' is not recognized as an internal or external command, operable program or batch file. ` @sandeepsingh – vivek kn Nov 25 '22 at 06:33
  • Are you running in windows, then it is gradlew not ./gradlew. on your question: Some of your node packages are using deprecated methods of the latest Gradle. You can downsize your Gradle in android/gradle/gradle-wrapper.properties – Vigeesh Kumar V G Nov 29 '22 at 05:16
  • 'gradlew' is not recognized as an internal or external command, operable program or batch file. @vijeeshin i am getting this error – vivek kn Nov 29 '22 at 05:18
  • @menucd are you running it in root folder, run it in android folder – Vigeesh Kumar V G Nov 29 '22 at 05:21
  • @menucd My recommendation gradlew clean then your rebuild – Vigeesh Kumar V G Nov 29 '22 at 05:24
  • i tryed that but now woeking can u guid me thorugh each steps – vivek kn Nov 29 '22 at 05:44
  • Hey can you please share your compileSdkVersion from android > build.gradle file For android 12 your targetSdkVersion and compileSdkVersion must be 31 or greater. – Adnan sayed Dec 02 '22 at 12:11
  • @Adnansayed buildscript { ext { kotlin_version = '1.6.10' // <- add this line buildToolsVersion = "31.0.0" minSdkVersion = 21 compileSdkVersion = 31 targetSdkVersion = 31 } – vivek kn Dec 03 '22 at 05:43
  • @Adnansayed i have compileSdkVersion = 31 targetSdkVersion = 31 – vivek kn Dec 03 '22 at 05:44
  • Ok thats good. did you upgraded your gradle plugin to the latest version using JDK11. Open your project`s android folder in AndroidStudio and check for gradle version and jdk. – Adnan sayed Dec 03 '22 at 06:22
  • @Adnansayed i am new to android studio can u walk me through the steps – vivek kn Dec 03 '22 at 06:27
  • i am using android studio dolphine – vivek kn Dec 03 '22 at 06:28
  • @Adnansayed which file should i check for gradle version and jdk. – vivek kn Dec 03 '22 at 06:50
  • check your jdk version by using cmd java -version in terminal. – Adnan sayed Dec 03 '22 at 07:12
  • @Adnansayed openjdk version "11.0.17" 2022-10-18 OpenJDK Runtime Environment Temurin-11.0.17+8 (build 11.0.17+8) OpenJDK 64-Bit Server VM Temurin-11.0.17+8 (build 11.0.17+8, mixed mode) – vivek kn Dec 03 '22 at 07:14
  • now see these steps from the answer https://stackoverflow.com/a/66450524/11070863 – Adnan sayed Dec 03 '22 at 07:19
  • @Adnansayed i dont see Build Tools inside Build, Execution, Deployment i have added screenshot – vivek kn Dec 03 '22 at 07:29
  • Please check this out https://stackoverflow.com/questions/67405791/gradle-tasks-are-not-showing-in-the-gradle-tool-window-in-android-studio-4-2 You also need to do some googling for yourself. – Adnan sayed Dec 03 '22 at 07:41
  • @Adnansayed there is no option Experimental | Do not build Gradle task list during Gradle sync. – vivek kn Dec 03 '22 at 07:52
  • @Adnansayed ok i found gradle but there is no option to download JDK11 pls refer the screenshot – vivek kn Dec 03 '22 at 08:04

1 Answers1

-3

In terminal, enter the android folder with

cd android

then run

.\gradlew clean

After that your app should run.