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.

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

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:8
  • Comments:22

github_iconTop GitHub Comments

2reactions
doouguicommented, Aug 24, 2022

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

1reaction
vankhoa01commented, Oct 12, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solving common problems - Gradle User Manual
Small problems in a build, like forgetting to declare a configuration file as an input to your task, can be easily overlooked. The...
Read more >
Troubleshooting builds - Gradle User Manual
You can verify the problem is with Gradle scripts by running gradle help which executes configuration scripts, but no Gradle tasks. If the...
Read more >
Dealing with validation problems - Gradle User Manual
This page summarizes the different task (or in general work) validation problems that Gradle reports and provides guidance for fixing them.
Read more >
Authoring Tasks - Gradle User Manual
Task has actions and Gradle has determined they should be executed as part of a build. Task has no actions and some dependencies,...
Read more >
Configuration cache - Gradle User Manual
Configuration cache problems found in tasks marked incompatible will no longer cause the build to fail. And, when an incompatible task is scheduled...
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