How to fix build gradle

awshakam98

I restarted the Android Studio and an error occurred during the build

Build failed show:


C:\Users\aws hakam\Desktop\freeLance\BottleOfWater\app\build\intermediates\external_file_lib_dex_archives\debug\out

The extension it points to does not exist

The details error


    Caused by: java.nio.file.NoSuchFileException: C:\Users\aws hakam\Desktop\freeLance\BottleOfWater\app\build\intermediates\external_file_lib_dex_archives\debug\out
    at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:79)
    at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
    at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
    at sun.nio.fs.WindowsDirectoryStream.<init>(WindowsDirectoryStream.java:86)
    at sun.nio.fs.WindowsFileSystemProvider.newDirectoryStream(WindowsFileSystemProvider.java:518)
    at java.nio.file.Files.newDirectoryStream(Files.java:457)
    at java.nio.file.Files.list(Files.java:3451)
    at com.android.build.gradle.internal.tasks.DexMergingParams.getAllDexFiles(DexMergingTask.kt:502)
    at com.android.build.gradle.internal.tasks.DexMergingTaskRunnable.run(DexMergingTask.kt:423)
    ... 28 more


David

I encountered this same error in a React Native project I am working on. I was able to resolve the issue through the following. Be sure to replace <PROJECT_NAME> below with your actual project name.

  1. Within Android Studio, select File > Invalid Cache and Restart.
  2. Open your project directory in your terminal.
  3. rm -rf .gradle
  4. rm -rf android/.gradle android/.idea
  5. rm android/app/app.iml android/<PROJECT_NAME>.iml

After doing this, I was able to open my project in Android Studio and successfully build. I had tried all but step 3 a few times without success, so my belief is that step 3 and the top-level .gradle directory in my project was the primary issue. I'm not sure how it got there.

One additional note, React Native projects place all of the Android-specific code inside an android directory. So, if your project is not a React Native project, and instead a traditional Android project, the paths I outlined for removal may be different (i.e. they wouldn't be underneath android/).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to fix this error ? Android Gradle Build Error?

How to fix this gradle build failure flutter?

How to fix gradle build error A problem occurred configuring root project?

How to fix duplicate classes in gradle build for android studio

How to fix "build.gradle" problem in a Cordova project?

How to fix gradle task ':app:mergeDebugJniLibFolders' in flutter gradle build for opencv native with NDK?

how to fix error gradle?

How to fix "Unmappable character for encoding windows-1252 error" displayed by Gradle build?

How do i fix my dependencies in my build.gradle file

How to fix mixed version in android build.gradle? (libraries must use the exact same version)

How to fix "Gradle build failed to produce an Android bundle package." in Flutter

Gradle create a empty folder `build/kotlin/sessions`, why? When i delete it comes back, how to fix it?

Annotation processor in Gradle outputs source files to build/classes making javadoc fail. How to fix it?

How to fix in android the error "Could not find com.android.tools.build:gradle:3.4.1"?

How to fix gradle build failed due to void org.gradle.api.internal.artifacts.dsl.LazyPublishArtifact.<init>(org.gradle.api.provider.Provider) error?

How to restore build.gradle and .Gradle folder

How to use gradle properties in build.gradle

How to fix error 'Cannot lock buildSrc build lock as it has already been locked by this process.' with Gradle 5 and GradleBuild tasks

Android gradle build Error "finished with non-zero exit value 42" , what does it mean and how do i fix it?

How to fix red warning of `import com.r3.testing.DistributeTestsBy` of build.gradle when using IDEA?

How to validate JSON in Gradle build

How to build sources jar with gradle

How to write dependencies in gradle build

How to test gradle build script

How to build a WAR file with gradle?

How to build jar on windows with gradle

How to convert a Maven build to Gradle?

how to execute 'gradle build' command from gradle.build script

How to call build.gradle from another build.gradle