gradle proj sync failed, every methods tried - java

error message:
Error:Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.
Open File<br>Show Details
This error is along with tons of similar dependencies errors.
methods tried:
clear caches
reinstall android studio
download the latest Gradle and replace the original one.
4. Play with the build.gradle file and add several lines
I am just a student who wants to start some android project with java.
Thanks in advance.
Here's my up-level gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
here's my gradle file for my proj:
apply plugin: 'com.android.application'
repositories {
maven {
url "https://s3.amazonaws.com/repo.commonsware.com"
}
jcenter()
google()
}
android {
compileSdkVersion 26
buildToolsVersion "26.0.2" // -------------------> Add this
defaultConfig {
applicationId "com.example.alexs.applicationone"
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'
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7: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'
implementation 'com.android.support.test.espresso:espresso-core:3.0.2-alpha1'
}
my sdk version is 27 btw.

Add buildToolsVersion "26.0.2" to build.gradle file like below :
android {
compileSdkVersion 26
buildToolsVersion "26.0.2" // -------------------> Add this
defaultConfig {
applicationId "com.example.alexs.applicationone"
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'
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

In your top-level build.gradle file, not the app module one you posted, add the following block:
allprojects {
repositories {
google()
}
}
Or in your app/build.gradle file (the one you posted) add the google repository:
repositories {
maven {
url "https://s3.amazonaws.com/repo.commonsware.com"
}
jcenter()
google()
}

Related

Android studio gradle sync issues

below is code of build.gradle project level
i ahvent opened it since few days before it was working now its give error as shown in image
i have tried updating gradle version
i have invalidate cache and restart
but nothing is working any help appriciated
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
maven {
url "https://maven.google.com" // Google's Maven repository
}
jcenter { url "http://jcenter.bintray.com/"}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.3.3'
}
}
allprojects {
repositories {
maven {
url "https://maven.google.com" // Google's Maven repository
}
jcenter { url "http://jcenter.bintray.com/"}
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
buidl.gradle 9app level
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
keyAlias 'xxx'
keyPassword 'xxx'
storeFile file('xxxx.jks')
storePassword 'xxxx'
}
}
compileSdkVersion 28
buildToolsVersion '29.0.2'
defaultConfig {
applicationId "xxxx"
minSdkVersion 18
targetSdkVersion 28
versionCode 13
versionName "1.0.13"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
}
productFlavors {
FREE {
minSdkVersion 18
applicationId 'XXXX'
signingConfig signingConfigs.config
targetSdkVersion 28
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
versionCode 13
versionName '1.0.13'
}
}
flavorDimensions "versionCode"
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta4'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'de.codecrafters.tableview:tableview:2.5.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
implementation 'com.github.f0ris.sweetalert:library:1.5.1'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.google.firebase:firebase-messaging:17.4.0'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
}
apply plugin: 'com.google.gms.google-services'

Cause: org.jetbrains.plugins.gradle.tooling.util Error

come easy,
I'm trying to get all the combinations but I can't get an error, I can't figure it out. The reason is:Cause: org.jetbrains.plugins.gradle.tooling.util.ModuleComponentIdentifierImpl.getModuleIdentifier()Lorg/gradle/api/artifacts/ModuleIdentifier;
More information
Gradle sync failed: Cause: org.jetbrains.plugins.gradle.tooling.util.ModuleComponentIdentifierImpl.getModuleIdentifier()Lorg/gradle/api/artifacts/ModuleIdentifier;
Consult IDE log for more details (Help | Show Log) (734 ms)
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion '29.0.2'
defaultConfig {
applicationId "pubg.looter.map"
minSdkVersion 22
targetSdkVersion 29
versionCode 2
versionName "1.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-messaging:19.0.1'
implementation 'com.google.android.gms:play-services-ads:18.1.0'
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

Android library dependencies

I'm doing an android library project.
The library project has compile some 3rd party library such as Volley.
When user use the library, user need to compile the volley too. If user do not compile, the app of user will not find the volley code.
But I don't want to the user compile volley library, just compile my library. Is there a solution to solve???
There is my library gradle
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
consumerProguardFiles 'proguard-rules.pro'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.squareup:seismic:1.0.1'
compile 'com.android.volley:volley:1.0.0'
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.android.support:recyclerview-v7:23.0.1"
compile "com.android.support:support-v4:23.0.1"
compile "com.android.support:support-annotations:23.0.1"
compile "com.android.support:design:23.0.1"
}
There is a sample app gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
minSdkVersion 15
targetSdkVersion 25
versionCode 108
versionName "3.1"
}
signingConfigs {
debug {
storeFile file("debug.jks")
storePassword 'develop'
keyAlias "develop"
keyPassword "develop"
}
}
buildTypes {
release {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
applicationIdSuffix ".debug"
minifyEnabled false
shrinkResources false
signingConfig signingConfigs.debug
}
}
lintOptions {
disable 'MissingTranslation'
abortOnError false
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
}
dependencies {
compile 'com.android.support:design:25.2.0'
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'org.jsoup:jsoup:1.10.2'
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'com.soundcloud.android:android-crop:1.0.1#aar'
compile 'com.getkeepsafe.taptargetview:taptargetview:1.8.0'
compile 'com.squareup:seismic:1.0.1'<<<<<<<<<<<<<<<<<<<< I need to hide this
compile 'com.android.volley:volley:1.0.0'<<<<<<<<<<<<<<< I need to hide this
compile project(':mylibrary')
}

Error:(4, 42) No resource found that matches the given name (at 'cardBackgroundColor' with value '?android:attr/colorBackgroundFloating')

Good day guys,
May i know why my recycler cardview message log shown this error?
Does anyone encounter this error before?
D:\New folder\DrawerWithSwipeTabs\app\build\intermediates\res\merged\debug\values-v23\values-v23.xml
Error:(4, 42) No resource found that matches the given name (at 'cardBackgroundColor' with value '?android:attr/colorBackgroundFloating').
Error:(4, 42) No resource found that matches the given name (at 'cardBackgroundColor' with value '?android:attr/colorBackgroundFloating').
It automatically pop up to D:\New folder\DrawerWithSwipeTabs\app\build\intermediates\res\merged\debug\values-v23\values-v23.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="CardView" parent="Base.CardView">
<item name="cardBackgroundColor">?android:attr/colorBackgroundFloating</item>
</style>
</resources>
build.gradle (Project)
// 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()
}
}
build.gradle (Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.androidbelieve.drawerwithswipetabs"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:design:22.2.1'
compile 'com.android.support:recyclerview-v7:25.1.1'
compile 'com.android.support:support-v4:25.1.1'
compile 'com.android.support:cardview-v7:25.1.1'
}
parent="Base.CardView"
this parent class is not introduce in sdk version 22.
To implement this you need to change your minSdk version and library version to sdk-version 23.
somthing like this.
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.androidbelieve.drawerwithswipetabs"
minSdkVersion 15
targetSdkVersion 23
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:recyclerview-v7:23.2.1'
compile 'com.android.support:support-v4:23.2.1'
compile 'com.android.support:cardview-v7:23.2.1'
}

Cannot change configuration ':PayUMoneySDK-Android-master:classpath' after it has been resolved

I am integrating PayU payment gateway and I am get the following error:
"Cannot change configuration ':PayUMoneySDK-Android-master:classpath' after it has been resolved."
"Cannot change configuration ':PayUMoneySDK-Android-master:classpath' after it has been resolved."
"Cannot change configuration ':PayUMoneySDK-Android-master:classpath' after it has been resolved."
I am using Android Studio, latest version.
The following is the build Gradle code:
apply plugin: 'com.android.library'
android {
compileSdkVersion 20
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 14
targetSdkVersion 20
versionCode 2
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildscript {
repositories {
mavenCentral()
}
dependencies
{
classpath 'com.android.tools.build:gradle:1.2.3'
}
}
}
dependencies {
compile('de.keyboardsurfer.android.widget:crouton:1.8.+#aar') {
exclude module: 'support-v7'
compile 'com.android.support:appcompat-v7:18.0.+'
classpath 'com.android.tools.build:gradle:1.1.1'
}
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'de.greenrobot:eventbus:2.2.1'
compile 'com.loopj.android:android-async-http:1.4.6'
compile 'com.mobsandgeeks:android-saripaar:1.0.3'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile project(':CustomBrowser-release')
}
The error is showing in "classpath 'com.android.tools.build:gradle:1.2.3'"..
The below dependencies are PayU dependencies

Categories

Resources