0
votes

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

2 Answers

1
votes

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.

1
votes

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