0

I have Android Studio version 2.2 and when I open a new project, it says in the Messages tab:

Error:C:\Users\Rooprai.gradle\caches\2.14.1\scripts-remapped\settings_4a7gjv1r4bbxs9f9pza41diyj\9ejwtyixtds2dlx9q4hqm4iap\cp_settings57408229\cache.properties (The system cannot find the file specified).

At the top of the screen it says:

Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly.

Build Gradle:

  // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.2.2'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
} }

allprojects { repositories { jcenter() } }

task clean(type: Delete) { delete rootProject.buildDir }

buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } }

Please help, the activity_main.xml won't work.

2 Answers 2

1

Go to the directory \Users\user\.gradle\caches\2.x.

You will find the directories scripts & scripts-remapped. Keep a backup of them and then delete them from the directory.

Retry gradle sync. It should work as it will generated new cache files.

Hope this helps. Thanks.

Sign up to request clarification or add additional context in comments.

Comments

1

add in your build.gradle

buildTypes {
release {
    minifyEnabled false
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}

Sync gradle then clean and rebuild project.it will work

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.