Could not load module metadata from
Asked Answered
A

5

16

I am stuck for a day now trying to solve this issue I just updated my android studio but when I open the old project it is showing error

Could not resolve all dependencies for configuration 
':app:debugAndroidTestRuntimeClasspath'.
Could not load module metadata from C:\Users\NEELAY\.gradle\caches\modules- 
2\metadata-2.36\descriptors\com.android.support\multidex- 
instrumentation\1.0.2\5ac5911800d0dfe0ba2d29f224b8c2fb\descriptor.bin
Unexpected metadata type found.

I followed some question also which say to uninstall the android support repository and reinstall but it is not working tried gradle.setting is also proper . Now i have no idea how to solve this issue any help will be helpfull. Manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="fireapp.manoj.template">
<uses-permission android:name="android.permission.INTERNET" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

</application>

this is the manifest code but dont know why it is showing as setting.gradle any idea why is it because of the gradle update

Approbate answered 24/4, 2018 at 13:28 Comment(9)
Please post your android manifestLotetgaronne
thx mate but dont know why it is coming like setting.gradleApprobate
Hey @Neelay what was the problem i'm facing the same issueVillanovan
@Smith It happens when the download is not done properly so i just deleted that file and android studio then ask you to download that file hope this will help youApprobate
but i tried deleting file and then again making project but still doesnt workVillanovan
Bro so you are opening the the old android studio file in my case the manifest file was comming as the gradle setting file so I deleated and download then I simply make another project and just copied the files in it dont know but for me it worked with meApprobate
Error:Could not resolve all dependencies for configuration ':app:debugAndroidTestRuntimeClasspath'. Could not load module metadata from /home/code/.gradle/caches/modules-2/metadata-2.23/descriptors/com.android.support.test/runner/1.0.2/da4190074d36b292f150a83ad82b6bb8/descriptor.bin Buffer underflow. Consult IDE log for more details (Help | Show Log)Villanovan
this is the error i'm gettingVillanovan
@Smith see your setting .gradle is it like the manifest ??Approbate
F
10

Remove the caches.

Step 1 : Open the terminal

Step 2 : paste cd C:\Users\NEELAY.gradle\ (Navigate to .gradle folder)

Step 3 : rm -r caches\

Step 4 : Now clean or rebuild the project

Fishnet answered 4/2, 2019 at 10:37 Comment(0)
A
10

Just clear metadata-2.36 folder in caches (no need to remove entire cache folder like suggested above) and do gradle clean build. I also faced the same issue and by following above step, my build became successful.

Alcoholism answered 28/5, 2020 at 9:47 Comment(0)
S
1

This problem may arise when the android studio couldn't update all the dependencies. Go to

file->project structure->dependencies

And make sure you update all the dependencies listed on the right side.

If it still pops out any issue delete the Gradle folder in the project and rebuild the project.

Saiz answered 3/2, 2020 at 13:56 Comment(0)
G
1
  1. Goto gradle path which is given in error. like: C:\Users\NEELAY\.gradle
  2. Delete the whole gradle folder (.gradle folder may be)
  3. Restart android studio and try to run now

If at 3. not worked:

  1. After all this (after deleting .gradle) uninstall android studio and reinstall it.

This worked for me.

Grendel answered 8/7, 2021 at 5:13 Comment(0)
A
1

The error message you're seeing typically occurs when Gradle's cache gets corrupted or is in an inconsistent state. This happens due to some varied reasons such as abrupt system shutdowns, disk space issues, or file system errors. To resolve this issue, you can try clearing the Gradle cache. Here's how you can do it:

  1. Close your IDE (Android Studio).

  2. Open a terminal.

  3. Run the following command to delete the Gradle cache:

    rm -rf ~/.gradle/caches/

  4. Restart your IDE and try to build your project again. This command will delete the entire Gradle cache directory. When you build your project again, Gradle will download all the necessary files and rebuild the cache. Please note that this might take some time depending on your internet speed and the size of your project.

I hope you find this helpfull.

Happy Building and Coding.

Asperity answered 8/6 at 8:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.