Skip to main content

Posts

Showing posts with the label Gradle

Build Failed with an Exception in Android Studio – Gradle Metadata Error

If you're encountering the following error during build in Android Studio: FAILURE: Build failed with an exception. * What went wrong: Multiple build operations failed. Could not read workspace metadata from C:\Users\abc\.gradle\caches\transforms- 4 \488376c3749de4c34a681b5fd5a06aa8\metadata. bin Could not read workspace metadata from C:\Users\abc\.gradle\caches\transforms- 4 \e2dc2f44e335b5e104801cc73d245ee1\metadata. bin This usually indicates corrupted Gradle cache files. How to Fix: Step 1: Open the Terminal in Android Studio (or use Command Prompt). Step 2: Navigate to the Gradle directory: cd C:\Users\<YourUsername>\.gradle\ Step 3: Remove the corrupted caches folder: bash rm -r caches\ On Windows, if using Command Prompt instead of terminal, use: c  rmdir /s /q caches Step 4: Go back to Android Studio and click Build > Clean Project or Rebuild Project . This should resolve the issue and allow your project to build successfully.

How to Register New File Type Association with MP3 in Android Studio

While working with mp3 file in your res\raw when Run the app (Shift+F10) android studio will ask for New File Type Association. There are two ways to handle this: First: Check the option "Open matching files in associated application" and click OK. Second: You can add manually and also remove the file association (If you have previously incorrectly associated "*.mp3" with something else, then Android Studio warns you and allows you to delete the old association). Select File -> Settings (Ctrl+Alt+S) -> File Types -> Files Opened In Associated Applications Click on the + sign Add "*.mp3" Click OK. Note: Resource names must contain lowercase a-z, 0-9 or underscores.