Skip to content
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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0 #29829

Closed
wontone18 opened this issue Sep 2, 2020 · 51 comments
Labels
DX Issues concerning how the developer experience can be improved. Needs: Attention Issues where the author has responded to feedback. Resolution: Locked This issue was locked by the bot. Tool: Flipper

Comments

@wontone18
Copy link

wontone18 commented Sep 2, 2020

Hi

i dont know whats wrong but i am getting this error continuously. Even i tried all with the fresh version also.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
27 actionable tasks: 27 executed
Note: D:\KikleeApp\master2\kikleeapp\android\app\src\debug\java\com\kikleeapp\ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Unable to install D:\KikleeApp\master2\kikleeapp\android\app\build\outputs\apk\debug\app-debug.apk
com.android.ddmlib.InstallException: INSTALL_FAILED_USER_RESTRICTED
        at com.android.ddmlib.Device.installRemotePackage(Device.java:1133)
        at com.android.ddmlib.Device.installPackage(Device.java:963)
        at com.android.ddmlib.Device.installPackage(Device.java:939)
        at com.android.ddmlib.Device.installPackage(Device.java:928)
        at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:126)
        at com.android.build.gradle.internal.tasks.InstallVariantTask.install(InstallVariantTask.java:175)
        at com.android.build.gradle.internal.tasks.InstallVariantTask.doTaskAction(InstallVariantTask.java:106)
        at com.android.build.gradle.internal.tasks.NonIncrementalTask$taskAction$$inlined$recordTaskAction$1.invoke(AndroidVariantTask.kt:51)
        at com.android.build.gradle.internal.tasks.NonIncrementalTask$taskAction$$inlined$recordTaskAction$1.invoke(AndroidVariantTask.kt:31)
        at com.android.build.gradle.internal.tasks.Blocks.recordSpan(Blocks.java:91)
        at com.android.build.gradle.internal.tasks.NonIncrementalTask.taskAction(NonIncrementalTask.kt:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:49)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:42)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:727)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:694)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.run(ExecuteActionsTaskExecuter.java:568)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:553)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:536)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:109)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:276)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:265)
        at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$1(ExecuteStep.java:33)
        at java.util.Optional.orElseGet(Optional.java:267)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:33)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
        at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:67)
        at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:36)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:49)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:34)
        at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:43)
        at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73)
        at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54)
        at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:34)
        at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:44)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:54)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:38)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49)
        at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:153)
        at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:67)
        at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:41)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:44)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:33)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:92)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:85)
        at java.util.Optional.map(Optional.java:215)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:55)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:39)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:76)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:94)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:49)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:79)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:53)
        at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:74)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:78)
        at java.util.Optional.orElseGet(Optional.java:267)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:78)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:39)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:40)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:28)
        at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:192)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:184)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:114)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:372)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:359)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:352)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:338)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
        at java.lang.Thread.run(Thread.java:748)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: INSTALL_FAILED_USER_RESTRICTED

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 12s

i tried all my procedures like for instance

  1. Fresh installation of android studio
  2. downgrade the jdk version
  3. removing buil, grade folder these things are different. Because i tried this all with a new fresh version also where it giving me the same error.

info Fetching system and libraries information...
System:
OS: Windows 10 10.0.18363
CPU: (4) x64 Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz
Memory: 1.43 GB / 5.59 GB
Binaries:
Node: 13.9.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: Version 4.0.0.0 AI-193.6911.18.40.6626763
Visual Studio: Not Found
Languages:
Java: 1.8.0_161
Python: 2.7.17
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.2 => 0.63.2
npmGlobalPackages:
react-native: Not Found

@react-native-bot react-native-bot added Needs: Author Feedback Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. and removed Needs: Triage 🔍 labels Sep 2, 2020
@github-actions
Copy link

github-actions bot commented Sep 2, 2020

⚠️ Missing Environment Information
ℹ️ Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console.

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Sep 2, 2020
@wontone18
Copy link
Author

Recent react native version having huge issues with android gradle. still i am finding its solution

@safaiyeh
Copy link
Contributor

safaiyeh commented Sep 2, 2020

Hi @wontone18, I looks like the Flipper version is causing issues.

We have an open PR for it here: #29787

Could you apply the diff to your project and see if it helps?

@safaiyeh safaiyeh added DX Issues concerning how the developer experience can be improved. Tool: Flipper Needs: Author Feedback and removed Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. Needs: Attention Issues where the author has responded to feedback. labels Sep 2, 2020
@wontone18
Copy link
Author

I will check the above point. But in my thinking its some where else is the issue. It making all the package components invalid and deprecated. Some of those packages we are regularly using

  1. asyncstorage
  2. webview

etc. gradle is somewhere making all these issues.

I can see several users are facing this issue but nobody getting a better result.

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Sep 2, 2020
@wontone18
Copy link
Author

Hi @wontone18, I looks like the Flipper version is causing issues.

We have an open PR for it here: #29787

Could you apply the diff to your project and see if it helps?

Same issue by using your flipper github version.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings
24 actionable tasks: 24 executed
Note: D:\sourcetest\reactnative\flipper\android\app\src\debug\java\com\mrltestnative\ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Unable to install D:\sourcetest\reactnative\flipper\android\app\build\outputs\apk\debug\app-debug.apk

@wontone18
Copy link
Author

Hi at last issue is resolve. There are few things to be check.

  1. check the project structure from android studio (suggestion option and instead of using + in the version put the version no)
  2. npm cache
  3. if debugging from mobile be sure developer mode should be switch off and on. Or else try with another device.
  4. i also deleted my npm_module and fresh install the npm packages but be sure to clean the npm cache.

@safaiyeh
Copy link
Contributor

safaiyeh commented Sep 3, 2020

@wontone18 glad you found a solution.

Currently React Native is not supporting Gradle 7.0, we are using v6.6. Is there any specific reason you need v7 support at this time?

@wontone18
Copy link
Author

wontone18 commented Sep 3, 2020

@wontone18 glad you found a solution.

Currently React Native is not supporting Gradle 7.0, we are using v6.6. Is there any specific reason you need v7 support at this time?

nah i am not using gradle 7 at all. React native already having a gradle plugin package in gradle wrapper. which is 6 but based on jdk version.

@RafaelZanetti
Copy link

@wontone18 glad you found a solution.
Currently React Native is not supporting Gradle 7.0, we are using v6.6. Is there any specific reason you need v7 support at this time?

nah i am not using gradle 7 at all. React native already having a gradle plugin package in gradle wrapper. which is 6 but based on jdk version.

Has anyone managed to solve this problem? I tried everything I found in this post and others, but without success.

@PereiraDiegoMiguel
Copy link

I solved the error creating a new 'react-native init' with the same name of the app, in another folder. Then I deleted the android folder of my app, and pasted the android folder of the new app. Now everything is working again.

@PereiraDiegoMiguel
Copy link

@wontone18 glad you found a solution.
Currently React Native is not supporting Gradle 7.0, we are using v6.6. Is there any specific reason you need v7 support at this time?

nah i am not using gradle 7 at all. React native already having a gradle plugin package in gradle wrapper. which is 6 but based on jdk version.

Has anyone managed to solve this problem? I tried everything I found in this post and others, but without success.

I solved the error creating a new 'react-native init' with the same name of the app, in another folder. Then I deleted the android folder of my app, and pasted the android folder of the new app. Now everything is working again.

@chrisglein
Copy link

Hi at last issue is resolve.

Based on the fact that original issue filer seems unblocked, closing this issue.

@erssebaggala
Copy link

I ran into the same error while debugging from the phone. The cause was I had manually uploaded and installed my app apk. After deleting the app from the phone, and all was fine after

@Js4Life
Copy link

Js4Life commented Nov 8, 2020

Do we have a boiler plate code to fix these incompatible issues for RN setup?

@mkraina
Copy link

mkraina commented Nov 9, 2020

for me the ./greadlew clean worked

@Cosby1992
Copy link

I had the same error and fixed it by deleting the \android\app\build\generated\not_namespaced_r_class_sources\debug\r\androidx folder. It was empty and saw something about not being able to delete this folder in the error text.
If that does not work, please try PereiraDiegoMiguel answer.
NOTE: React Native seems to have no problem building with the gradle errors. So expect to look for other errors than just gradle errors. I still get the gradle 7.0 error but it builds fine.

@peterhungh3
Copy link

peterhungh3 commented May 13, 2021

I recently encountered this with an error related to Firebase:

RNPushNotification.java:37: error: cannot find symbol
import com.google.firebase.iid.FirebaseInstanceId;

And this solution worked for me. (adding firebaseMessagingVersion = "21.1.0" to ext {...})

@Luckygirlllll
Copy link

I got this error as well today: "Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0."

It looks like it complains about bunch of libraries such as: react-native-async-storage_async-storage, react-native-gesture-handler, react-native-webview, react-native-screens, react-native-firebase_app.

Any updates about this issue?

@moGeekHex
Copy link

I got this error as well today: "Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0."

It looks like it complains about bunch of libraries such as: react-native-async-storage_async-storage, react-native-gesture-handler, react-native-webview, react-native-screens, react-native-firebase_app.

Any updates about this issue?

I have the same problem too

@aditya781
Copy link

Hi at last issue is resolve. There are few things to be check.

  1. check the project structure from android studio (suggestion option and instead of using + in the version put the version no)
  2. npm cache
  3. if debugging from mobile be sure developer mode should be switch off and on. Or else try with another device.
  4. i also deleted my npm_module and fresh install the npm packages but be sure to clean the npm cache.

its not working

@elicwhite
Copy link
Member

Reopening since RN still doesn’t work with Gradle 7 it seems. A workaround to downgrade to Gradle 6 is helpful but not long term feasible.

@elicwhite elicwhite reopened this Jul 6, 2021
@ShikaSD
Copy link
Contributor

ShikaSD commented Jul 6, 2021

Most of the issues I see reported in this thread seem unrelated to Gradle 7 upgrade. The actual warning (from the issue title) is from Gradle 6, notifying that some things WILL break with the upgrade.
It is a bit misleading step from the Gradle side, but should not be a cause of the build failure.

@pranayperiwal
Copy link

Even after downgrading Gradle on my system, I still have the same issue. Anyone else?

@flora8984461
Copy link

flora8984461 commented Jul 12, 2021

I still have the issue, and it's caused by unimodules-core (the dependency of react-native-unimodules)

> Task :unimodules-core:compileDebugJavaWithJavac FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8/userguide/command_line_interface.html#sec:command_line_warnings
420 actionable tasks: 420 executed

And my react native is 0.63.4, "react-native-unimodules" is "~0.13.3", and my @unimodules/core is 7.1.0. My project is ejected from Expo.

@brgopalakrishnan
Copy link

Same here. react native cli builds good without uni module android confuguration. Once I apply the changes from https://docs.expo.io/bare/installing-unimodules/. Build break with message

Task :app:processDebugResources FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:processDebugResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
\app\node_modules\expo-file-system\android\build\intermediates\library_manifest\debug\AndroidManifest.xml:16:5-22:15: AAPT: error: unexpected element found in .

@flora8984461
Copy link

flora8984461 commented Jul 17, 2021

I still have the issue, and it's caused by unimodules-core (the dependency of react-native-unimodules)

> Task :unimodules-core:compileDebugJavaWithJavac FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8/userguide/command_line_interface.html#sec:command_line_warnings
420 actionable tasks: 420 executed

And my react native is 0.63.4, "react-native-unimodules" is "~0.13.3", and my @unimodules/core is 7.1.0. My project is ejected from Expo.

An update on my issue, I added org.gradle.java.home in gradle.properties to point to my correct jdk location ( I installed jdk1.8.0 ), then run expo run:android or npm run android, it suddenly works. Not sure if it can help anyone.

@ivarchand
Copy link

Experienced the same issue, while migrating RN from 0.62.2 to 0.63.4

Used Gradle setup:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip
classpath 'com.android.tools.build:gradle:3.5.3'

Initial Steps:
On Mac terminal, ./gradlew clean - was not helpful
On Android Studio, invalidate cache & restart - was not helpful

Next Steps :
While doing Gradle sync in android studio, found out that android studio is configured to wrong jdk location (Applications/Android Studio.app/Contents/jre/jdk/Contents/Home). JDK location is changed as per ./bash_profile JAVA_HOME='/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home'. point to be noted - Different JDK location for Different process might cause gradle to spawn multiple deamons

Moreover, after taking the stacktrace for react-native run-android --variant=release--stacktrace, found out that some junks were added unexpectedly at android/app/src/main/res/raw/* which throws Error: Duplicate resources, Those are trashed.

Then, cleanup of junks at all levels of cache (Project, User/username/.gradle, /var/root/.gradle) is done

Then, now able to generate the release mode build. Issue is fixed

Note - Weird thing here is no issue on debug mode build

Thanks

@gonalc
Copy link

gonalc commented Sep 18, 2021

After a long time dealing with this, I got it by trying all Gradle distributions from top to bottom until one of them works. In my case it has been 6.9.

After changing the following line:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip in android/gradle/wrapper/gradle-wrapper.properties

Only needed to change the version number.

I ran the following command:
cd android && ./gradlew clean

I hope this helps!

@tomasjavorsky
Copy link

tomasjavorsky commented Oct 4, 2021

  1. init project with expo init
  2. open android folder in Android studio
  3. accept prompt saying something about upgrading gradle and stuff
  4. close android studio and open your expo project in your IDE... launch it trough npm scripts (react-native android-start)

@munnokd
Copy link

munnokd commented Oct 8, 2021

@RickameCua ya its working this tips for my project

@stale
Copy link

stale bot commented Jan 9, 2022

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 9, 2022
@cortinico
Copy link
Contributor

I believe we can close this as the upcoming version of RN will run on Gradle 7.3.3. Is there anything else to be done here?

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 10, 2022
@ShikaSD
Copy link
Contributor

ShikaSD commented Jan 10, 2022

Agreed, closing as RN has been migrated to support Gradle 7+

@moustaouiSalaheddine
Copy link

Try this solution worked for me.
If you have another app with the same name (or package name) on the device: Rename the app or delete it from your device.

@sheralirozdar
Copy link

I am still having this issue - not a signle solution worked for me. :(
`> Task :app:processDebugGoogleServices 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.`

@dvchinh
Copy link

dvchinh commented Nov 9, 2022

I solved the error creating a new 'react-native init' with the same name of the app, in another folder. Then I deleted the android folder of my app, and pasted the android folder of the new app. Now everything is working again.

Awesome! It works well on my end. Thank you so much.

@Hostname47
Copy link

Unfortunately, it was a good experience using react native to develop mobile apps but I found my self wasting a lot of time just solving issue after issue, it's been more than 1 week now of headaches with those errors. I hope RN team work on this side and try to solve those problems

@facebook facebook locked as resolved and limited conversation to collaborators Nov 23, 2022
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jan 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
DX Issues concerning how the developer experience can be improved. Needs: Attention Issues where the author has responded to feedback. Resolution: Locked This issue was locked by the bot. Tool: Flipper
Projects
None yet
Development

No branches or pull requests