Failed to resolve Twitter SDK - android

I am getting this error while building the android project :
Error:Failed to resolve: com.twitter.sdk.android:twitter:2.0.0
This is my gradle file :
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '22.0.1'
defaultConfig {
applicationId "com.khurana.nikhil.tuhub"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
manifestPlaceholders = [manifestApplicationId : "${applicationId}",
onesignal_app_id : "3363b4de-b4d3-45c7-a74a-2d75d7a97848",
onesignal_google_project_number: "561678063868"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.+'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.google.firebase:firebase-database:10.0.0'
compile 'com.firebaseui:firebase-ui:1.0.0'
compile 'com.onesignal:OneSignal:2.+#aar'
compile 'com.google.android.gms:play-services-gcm:10.0.0'
compile 'com.google.android.gms:play-services-analytics:10.0.0'
compile 'com.google.android.gms:play-services-location:10.0.0'
compile 'com.google.firebase:firebase-core:10.0.0'
compile 'com.google.android.gms:play-services:10.0.0'
}
apply plugin: 'com.google.gms.google-services'
I tried this solution mentioned in one of the post but that didn't work. Here's the solution I found :
Adding this to project gradle Repository section
maven { url 'https://maven.fabric.io/repo' }
But this didn't work.
Tried this too :maven { url 'https://maven.fabric.io/repo' }

Adding the repository worked for me. Here's my build gradle(project)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
// Google Play Services classpath
classpath 'com.google.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()
maven { url 'https://maven.fabric.io/public' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Hope this helps :)

Related

Update SDK: Failed to resolve: com.android.support:appcompat-v7

I'm using Android Studio 2.3.3 and updated my SDK version and now I'm using API 27 but I encountered the following error:
Also I install repository and sync project but This error occurred:
This code is gradle.build (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.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Also this code is gradle.build (Module:app )
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '28.0.0'
defaultConfig {
applicationId "comp.packk.ir"
minSdkVersion 14
targetSdkVersion 27
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(include: ['*.jar'], dir: 'libs')
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:27.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:27.1.1'
}
What is the solution?
implementation or compile 'com.android.support:appcompat-v7:27.1.1'
implementation or compile 'com.android.support:cardview-v7:27.1.1'
implementation or compile 'com.android.support:design:27.1.1'

Failed to resolve: com.google.firebase:firebase-database:11.4.2

I have added dependencies and also added maven { url "https://maven.google.com" } to my build.gradle files. But still getting errors as:
Failed to resolve com.google.firebase:firebase-database:11.4.2
Failed to resolve com.google.firebae:firebase-core:11.4.2
This is the build.gradle file in root one
buildscript {
repositories {
jcenter()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenLocal()
maven{ url "https://maven.google.com" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
The below is build.gradle file in app one
apply plugin: 'com.android.application'
repositories {
mavenLocal()
flatDir {
dirs 'libs'
}
}
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.google.firebase.udacity.friendlychat"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:24.2.0'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.google.firebase:firebase-core:11.4.2'
compile 'com.google.firebase:firebase-database:11.4.2'
// Displaying images
compile 'com.github.bumptech.glide:glide:3.6.1'
}
apply plugin: 'com.google.gms.google-services'
Any help here!
Update compileSdkVersion to at least 26. From https://developers.google.com/android/guides/releases,
"When you upgrade your app’s Play services dependencies to 11.2.0 or later, your app’s build.gradle must also be updated to specify a compileSdkVersion of at least 26 (Android O)."

Error trying to import firebase-ui

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.

duplicate entry: com/google/common/collect/package-info.class in android

surprisingly i am facing a error of duplicate entry after i upate my android studio 2.2.1 to 2.2.2. i have searched in google but there is no similar solution.
this is error:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/common/collect/package-info.class
build.gradle(module:app):
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.systechdigital.webadeal"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
configurations {
compile.exclude group: "org.apache.httpcomponents", module: "httpclient"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:24.0.0-beta1'
compile 'com.android.support:design:24.0.0-beta1'
compile 'com.google.android.gms:play-services-auth:10.0.0'
compile 'com.google.android.gms:play-services:10.0.0'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.github.delight-im:Android-AdvancedWebView:v3.0.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.gdata:core:1.47.1'
compile 'com.survivingwithandroid:weatherlib_okhttpclient:1.6.0'
compile 'com.google.api-client:google-api-client:1.20.0'
}
apply plugin: 'com.google.gms.google-services'
build.gradle:
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.google.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()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
how to solve this. i googled a lot but no similar error or solution i found
I guess your volley:library is old ,That's why problem .Use latest version .
Step 1
compile 'com.mcxiaoke.volley:library:1.0.19'
Step 2
Downgrade version com.google.android.gms:play
compile 'com.google.android.gms:play-services:9.2.1' //9.6.1
compile 'com.google.android.gms:play-services-auth:9.2.1' //9.6.1
Finally Clean-Rebuild Your Project .
FYI
Downgrade is not good practice . You can change your buildToolsVersion if you want to use com.google.android.gms:play-services:10.0.0
compileSdkVersion 25
buildToolsVersion "25.0.1"

how to import Materialrecent design in android app

I am trying to import Github library about Material design from https://github.com/ZieIony/MaterialRecents but I am facing this type of error:
("Error:Dependency com.github.ZieIony:MaterialRecents:d2aec46f48 on project app resolves to an APK archive which is not supported as a compilation dependency. File: C:\Users\Talha\.gradle\caches\modules-2\files-2.1\com.github.ZieIony\MaterialRecents\d2aec46f48\494f96d345471f38b6f3f4c1c42347a2b42f8303\MaterialRecents-d2aec46f48.apk")
My Gradle is
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.talha.myrecentdesign"
minSdkVersion 14
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(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.github.ZieIony:MaterialRecents:d2aec46f48'
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'
compile 'com.nineoldandroids:library:2.4.0'
}
and
// 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'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I have searched from many sites but not find the exact solution. Please help me.
The library you are reffering to uses CardView which is part of the android support design library, so you have to add a dependency for that aswell.
compile 'com.android.support:design:22.2.0'

Categories

Resources