question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android: gradle wrapper 7.2 yields 'execution optimizations disabled' warning

See original GitHub issue

Environment

  • macOS 12.1
  • RN 0.67.0
  • RNVI 9.0.0

Description

I have added react-native-vector-icons to my React Native project using RN 0.67. I am using Gradle wrapper 7.3.3 but the behaviour is the same for 7.2.

When running npx react-native run-android --variant debug I see the following in the terminal:

> Task :app:compressDebugAssets
Execution optimizations have been disabled for task ':app:compressDebugAssets' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: '/Users/studiozeffa/Code/rn-project/android/app/build/intermediates/merged_assets/debug/out'. Reason: Task ':app:compressDebugAssets' uses this output of task ':app:copyDebugReactNativeVectorIconFonts' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.

The same warning is repeated for other gradle tasks too.

This is just a warning - the app still compiles and builds ok

Reproducible Demo

  • Create a new RN project using RN 0.67 (this is important as it uses the latest Gradle plugin version)
  • Add RNVI v9.0.0
  • Run npx react-native run-android --variant debug

Dirty workaround

I’ve added the following to fonts.gradle which removes the warning, but I am sure there is a better way to do this.

def compressAssetsTask = tasks.findByName("compress${targetName}Assets")
compressAssetsTask.dependsOn(currentFontCopyTask)

def processMainManifestTask = tasks.findByName("process${targetName}MainManifest")
processMainManifestTask.dependsOn(currentFontCopyTask)

def processManifestTask = tasks.findByName("process${targetName}Manifest")
processManifestTask.dependsOn(currentFontCopyTask)

def processManifestForPackageTask = tasks.findByName("process${targetName}ManifestForPackage")
processManifestForPackageTask.dependsOn(currentFontCopyTask)

def mergeJavaResourceTask = tasks.findByName("merge${targetName}JavaResource")
mergeJavaResourceTask.dependsOn(currentFontCopyTask)

def mergeExtDexTask = tasks.findByName("mergeExtDex${targetName}")
mergeExtDexTask.dependsOn(currentFontCopyTask)

def mergeNativeLibsTask = tasks.findByName("merge${targetName}NativeLibs")
mergeNativeLibsTask.dependsOn(currentFontCopyTask)

def mergeResourcesTask = tasks.findByName("merge${targetName}Resources")
mergeResourcesTask.dependsOn(currentFontCopyTask)

def stripDebugSymbolsTask = tasks.findByName("strip${targetName}DebugSymbols")
stripDebugSymbolsTask.dependsOn(currentFontCopyTask)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:6
  • Comments:10

github_iconTop GitHub Comments

1reaction
fadi-quader-moxcommented, Apr 13, 2022

same here

1reaction
jetaggartcommented, Feb 3, 2022

I’m having this issue as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native Execution optimizations have been disabled for ...
I had a similar problem (on Java 17), and got fix by the following steps: 7.4.2 is the latest gradle version at the...
Read more >
Upgrading your build from Gradle 7.x to the latest
Run gradle wrapper --gradle-version 7.6 to update the project to 7.6. Try to run the project and debug any errors using the Troubleshooting...
Read more >
Gradle 7 Warning: Execution optimizations have been disabled
Upgrading to Gradle 7 may offer you some new warnings. One of the warnings I experienced was about disabled execution optimizations.
Read more >
LintOptions | Android Developers
if true, treat all warnings as errors warningsAsErrors true // turn off checking the given issue id's disable 'TypographyFractions' ...
Read more >
What's new in Kotlin 1.8.0
This workaround allows any build script or plugin to modify kotlinOptions.freeCompilerArgs in the execution phase but produces a warning in the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found