expo: Gradle detected a problem with task :expo-constants:createDebugExpoConfig

Summary

After installing React Navigation following these two^1 pages of instructions, I’m seeing the following new output when I run npx react-native run-android:

Execution optimizations have been disabled for task ':expo-constants:createDebugExpoConfig' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: '/Users/rob/code/lettery/android'. Reason: Task ':expo-constants:createDebugExpoConfig' uses this output of task ':app:checkDebugAarMetadata' 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.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  - Gradle detected a problem with the following location: '/Users/rob/code/lettery/android'. Reason: Task ':expo-constants:createDebugExpoConfig' uses this output of task ':app:compileDebugAidl' 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.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  - Gradle detected a problem with the following location: '/Users/rob/code/lettery/android'. Reason: Task ':expo-constants:createDebugExpoConfig' uses this output of task ':app:compileDebugRenderscript' 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.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  - Gradle detected a problem with the following location: '/Users/rob/code/lettery/android'. Reason: Task ':expo-constants:createDebugExpoConfig' uses this output of task ':app:compileDebugShaders' 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.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  - Gradle detected a problem with the following location: '/Users/rob/code/lettery/android'. Reason: Task ':expo-constants:createDebugExpoConfig' uses this output of task ':app:generateDebugBuildConfig' 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.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  - Gradle detected a problem with the following location: '/Users/rob/code/lettery/android'. Reason: Task ':expo-constants:createDebugExpoConfig' uses this output of task ':app:javaPreCompileDebug' 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.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  - Gradle detected a problem with the following location: '/Users/rob/code/lettery/android'. Reason: Task ':expo-constants:createDebugExpoConfig' uses this output of task ':app:mergeDebugShaders' 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.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.

The Gradle page^3 referenced in the above output summarizes:

This error indicates that you have a task which depends on another, but that no explicit or implicit dependency is declared between those two tasks.

So I have two questions:

  1. Any idea why this only started after installation of React Navigation?
  2. My app still runs in development, but should I be concerned?

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

bare

What platform(s) does this occur on?

Android

SDK Version (managed workflow only)

No response

Environment

expo-env-info 1.0.2 environment info:
  System:
    OS: macOS 12.2
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
    npm: 8.3.1 - ~/.nvm/versions/node/v16.14.0/bin/npm
    Watchman: 2022.01.24.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK:
      API Levels: 25, 28, 29, 30, 31
      Build Tools: 25.0.2, 28.0.3, 29.0.1, 29.0.2, 30.0.2, 30.0.3, 32.0.0
      System Images: android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-29 | Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom
  IDEs:
    Android Studio: 2020.3 AI-203.7717.56.2031.7935034
    Xcode: 13.3/13E113 - /usr/bin/xcodebuild
  npmPackages:
    expo: >=44.0.0-0 <45.0.0 => 44.0.6 
    react: 17.0.2 => 17.0.2 
    react-native: 0.67.3 => 0.67.3 
  npmGlobalPackages:
    expo-cli: 5.2.0
  Expo Workflow: bare

Reproducible demo

This is the entirety of my app at the moment (yes, I’m just getting started 🙂 ):

import React, { useCallback, useEffect, useState } from 'react'
import { createNativeStackNavigator } from '@react-navigation/native-stack'
import { getItemAsync } from 'expo-secure-store'
import { hideAsync, preventAutoHideAsync } from 'expo-splash-screen'
import { NavigationContainer } from '@react-navigation/native'
import { Text, View } from 'react-native'

const { Navigator, Screen } = createNativeStackNavigator()

const Welcome = (): JSX.Element => {
  return (
    <View>
      <Text>Welcome Screen</Text>
    </View>
  )
}

const App = (): JSX.Element | null => {
  const [loaded, setLoaded] = useState(false)

  useEffect((): void => {
    const getLocalData = async (): Promise<void> => {
      try {
        await preventAutoHideAsync()

        const token: string | null = await getItemAsync('token')

        if (token) {
          // TODO .... Fire off a request to find this user by token.
        }
      } catch (err) {
        console.warn(err)
      } finally {
        setLoaded(true)
      }
    }

    getLocalData()
  }, [])

  const onReady = useCallback(async (): Promise<void> => {
    if (loaded) {
      await hideAsync()
    }
  }, [loaded])

  if (!loaded) {
    return null
  }

  return (
    <NavigationContainer onReady={onReady}>
      <Navigator screenOptions={{ headerShown: false }}>
        <Screen component={Welcome} name='Welcome' />
      </Navigator>
    </NavigationContainer>
  )
}

export default App

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 11
  • Comments: 33

Most upvoted comments

Hi there! It looks like your issue requires a minimal reproducible example, but it is invalid or absent. Please prepare such an example and share it in a new issue.

The best way to get attention to your issue is to provide a clean and easy way for a developer to reproduce the issue on their own machine. Please do not provide your entire project, or a project with more code than is necessary to reproduce the issue.

A side benefit of going through the process of narrowing down the minimal amount of code needed to reproduce the issue is that you may get lucky and discover that the bug is due to a mistake in your application code that you can quickly fix on your own.

Resources

Common concerns

“I’ve only been able to reproduce it in private, proprietary code”

You may not have spent enough time narrowing down the root cause of the issue. Try out the techniques discussed in this manual debugging guide to learn how to isolate the problem from the rest of your codebase.

“I didn’t have time to create one”

That’s understandable, it can take some time to prepare. We ask that you hold off on filing an issue until you are able to fully complete the required fields in the issue template.

“You can reproduce it by yourself by creating a project and following these steps”

This is useful knowledge, but it’s still valuable to have the resulting project that is produced from running the steps, where you have verified you can reproduce the issue.

closed… even though everyone encounters this…

Any updates on this? I’m using MacOS here and this error appeared after upgrading to Expo SDK 45

I fixed this issue by downgrading gradle to version 7.6.2 following this StackOverflow answer:

  • delete content of .gradle folder in project root.
  • open android studio, click File->Project structure, then change gradle version to 7.6.2.
  • rebuild

Hi my friends, I got same issue when upgrade Android Target API to 33 And it’s blocking my project Is there any solution to fix it ?

Thank you so much

@neelspansare No, but it’s not blocking my project. Come to think of it, I’m not even sure it’s an issue with expo since it only started after I installed React Navigation. 🤷‍♂️