build gradle failed with analytics setting error what can i do? - android-studio

i clone a project from github into android studio 3.0.1 and when start build gradle show error message :
Error:(1, 0) com/android/tools/analytics/AnalyticsSettings "Open File"
and then i click open file open build.gradle
this is my build.gradle :
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "test.myapplication"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
what can i do ?
thank for answer

Related

Failed to resolve: com.google.android.gms:play-services-clearcut:12.0.1

when I implement google places dependency and sync the Gradle file then it shows an error
Failed to resolve: com.google.android.gms:play-services-clearcut:12.0.1
App-level build. Gradle file
apply plugin : 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.hatimtekri.googlemap"
minSdkVersion 22
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
//noinspection UseOfBundledGooglePlayServices
implementation 'com.google.android.gms:play-services:12.0.1'
implementation 'com.google.android.libraries.places:places:2.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
dependency
implementation 'com.google.android.libraries.places:places:2.0.0'
please please solve this error

Cannot sync project with gradle files

i cannot sync my project with gradle files.
i have this problem with all projects!
error:
Gradle sync failed: com.android.ide.common.gradle.model.level2.IdeDependenciesFactory.setRootBuildId(Ljava/lang/String;)Vcom.android.ide.common.gradle.model.level2.IdeDependenciesFactory.setRootBuildId(Ljava/lang/String;)V
i've tried change my gradle dist to newest version (gradle-4.10.3-all) and i've tried delete gradle caches.
in your classpath use:
classpath 'com.android.tools.build:gradle:3.2.1'
Now in build.gradle copy this code and make it correct as per your application.
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.yourapp"
minSdkVersion 25
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2
}

Failed to load AppCompat ActionBar with unknown error. Tip: Try to refresh the layout

I looked for already asked question but they was on older version of android studio and they doesn't work. As you can see I don;t have buildToolsVersion,compile and classpath
.My gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.illuminat.button"
minSdkVersion 22
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
Open app Build.gradle file.
In dependencies replace: 'com.android.support:appcompat-v7:28.0.0-alpha3'by
'com.android.support:appcompat-v7:28.0.0-alpha1'
Clic en Sync.
In res/values/style.xml change style tag to

unable to find attribute constraintSet

I had this error after I accidentally deleted something on a .debug file.
Error:In ConstraintLayout_Layout, unable to find attribute layout_constraintBaseline_creator
Error:In ConstraintSet, unable to find attribute layout_constraintBaseline_creator
Here is my build.gradle code
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "myapp.project.com.myapp"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
Do you have an idea how to fix this error? This error has not been removed even if I pull a new project from git. Thank you in advance.

Why is it giving an error cause compileSdkVersion is not specified in android studio?

apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.debu.mrsarkar.bangalighyam"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.squareup.okhttp:okhttp:2.7.2'
testImplementation 'junit:junit:4.12'
implementation 'com.firebaseui:firebase-ui-database:3.1.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'com.google.android.gms:play-services-basement:11.8.0'
compile 'com.google.android.gms:play-services-auth:11.8.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support:support-vector-drawable:26.1.0'
}
apply plugin: 'com.google.gms.google-services'
Please see bottom left side. The error is showing again and again.
Please help me in solving the error.Please!!

Resources