when i create empty android project in Android Studio or intel idea
I get same errors
Error:Error: Duplicate resources
Error:Execution failed for task ':app:mergeDebugResources'.
[style-ldltr-v21/Base.Widget.AppCompat.Spinner.Underlined]
MyApplication244/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/25.1.1/res/values-ldltr-v21/values-ldltr-v21.xml
[style-ldltr-v21/Base.Widget.AppCompat.Spinner.Underlined]
MyApplication244/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/25.1.1/res/values-ldltr-v21/values-ldltr-v21.xml: Error: Duplicate resources
my build.gradle(app) file
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.inoob.myapplication244"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:25.1.1'
}
build.gradle(MyApplication244)
// 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.3'
// 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
}
I tried change api version. 21,22,23
But i have same problem.
Please describe me what it mean . I newcomer in android.
Related
I'm building an android app to store a text file in the google drive.According to my perspective, the code is OK. But when I put the app level dependency of the google play-services, it throws an error in the app level version dependency. Due to this reason, I cannot sync the gradle. I think the error is with the version numbers.
here is the play service dependency I put
"compile 'com.google.android.gms:play-services:8.4.0'"
And this is the dependency that shows as an error when I put the above dependency
"compile 'com.android.support:appcompat-v7:23.4.0'"
Here is my app level graddle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.xxxxx.calllogtogoogledrive"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services:8.4.0'
}
Here is the project level 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.3.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
}
Could you try to change your build.gradle like this;
allprojects {
repositories {
maven { url "http://jcenter.bintray.com" }
}
Remove jcenter() add this.
I want to use RequestQeue for basic HTTP connection and I know that this question is asked many times but none of the solutions that is suggested does not work for me. I have searched through the every single answer but it did not help. Here is my project and module gradle in the below. I would be appreciated if someone give me a tip; This is the error message : Failed to resolve:com.mcxiaoke.volley:library:1.0.19
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.pc.wampproj"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
}
The module;
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I need to import firebase-ui for my app but I am getting this error when I sync gradle
Error:Could not find com.google.services.gms:google-services:3.0.0.
Searched in the following locations:
file:/D:/NewAndroid/androidStudios/mew/gradle/m2repository/com/google/services/gms/google-services/3.0.0/google-services-3.0.0.pom
file:/D:/NewAndroid/androidStudios/mew/gradle/m2repository/com/google/services/gms/google-services/3.0.0/google-services-3.0.0.jar
https://jcenter.bintray.com/com/google/services/gms/google-services/3.0.0/google-services-3.0.0.pom
https://jcenter.bintray.com/com/google/services/gms/google-services/3.0.0/google-services-3.0.0.jar
Required by:
project :
I just downloaded android studio so everything is up to date and everything works until I try to import firebase-ui.
build.gradle(Project:ChatApp)
// 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.1'
classpath 'com.google.services.gms:google-services:3.0.0'
// 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
}
build.gradle(Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.emilythacker.chatapp"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
//Add library
compile 'com.android.support:design:25.3.1'
compile 'com.firebaseui:firebase-ui:1.2.0'
}
In your project build.gradle file, this:
classpath 'com.google.services.gms:google-services:3.0.0'
should be:
classpath 'com.google.gms:google-services:3.0.0'
To resolve the twitter error, update your project build.gradle:
allprojects {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' } // <= ADD THIS
}
}
It's needed by Firebase Auth UI.
AndroidStudio 2.2.3 is failing to resolve my RealmRecyclerViewAdapter reference. I've followed the RecyclerViewAdaper example straight from the Realm site. Could someone help me figure out why it's not finding RealmRecyclerViewAdapter?
Here are my import statements:
import io.realm.OrderedRealmCollection;
import io.realm.RealmRecyclerViewAdapter; //this fails
Here's my project-level gradle file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'io.realm:realm-gradle-plugin: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
}
Here's my application-level gradle file:
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.creditcardcalcx"
minSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
testCompile 'junit:junit:4.12'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
}
Yeah, you're missing the following dependency
dependencies {
compile 'io.realm:android-adapters:1.4.0'
}
For some reason gradle can't resolve any of my dependencies. This is an example:
Module:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "app.simplelogin"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.squareup.okhttp3:okhttp:3.0.1'
testCompile 'junit:junit:4.12'
}
Project:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
When I try to sync or build, I get the following error:
Failed to resolve: com.squareup.okhttp3:okhttp:3.0.1
I get this same error message with every dependency I try to add - anyone know why?
You probably have switched on offline mode in the Gradle tool window of Android Studio. Switch off offline mode and it should work if you have internet connection.