Failed to resolve: com.twitter.sdk.android:tweet-composer - android

compile('com.twitter.sdk.android:tweet-composer:0.8.0#aar')
{
transitive = true;
}
i got gradle from https://dev.twitter.com/twitter-kit/android/compose
But when Sync the Android Studio project following error is coming ..
Error:(53, 13) **Failed to resolve: **com.twitter.sdk.android:tweet-composer:0.8.0****
Show in FileShow in Project Structure dialog

As was described on twitter, you have to change some parts in your module build.gradle.
In your module you can use:
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
// The Fabric Gradle plugin uses an open ended version to
// react quickly to Android tooling updates
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
//Put Fabric plugin after Android plugin
apply plugin: 'io.fabric'
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
I suggest you installing the Android Studio plugin.
It helps you to configure the gradle script.

This help me
https://dev.twitter.com/twitterkit/android/installation
dependencies {
// Include all the Twitter APIs
compile 'com.twitter.sdk.android:twitter:3.0.0'
// (Optional) Monetize using mopub
compile 'com.twitter.sdk.android:twitter-mopub:3.0.0'
}
OR
enter code dependencies {
compile 'com.twitter.sdk.android:twitter-core:3.0.0'
compile 'com.twitter.sdk.android:tweet-ui:3.0.0'
compile 'com.twitter.sdk.android:tweet-composer:3.0.0'
compile 'com.twitter.sdk.android:twitter-mopub:3.0.0'
}

Related

Issue with android gradle plugin version 3.3 and OneSignal

When I updated, Gradle 4.6 -> 4.10.1 and the Android Gradle plugin 3.2.1 -> 3.3.1, I get the following errors:
ERROR: Unable to resolve dependency for ':app#releaseUnitTest/compileClasspath': Could not resolve com.google.firebase:firebase-messaging:[10.2.1, 12.1.0).
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#releaseUnitTest/compileClasspath': Could not resolve com.android.support:support-v4:[26.0.0, 27.2.0).
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#releaseUnitTest/compileClasspath': Could not resolve com.android.support:customtabs:[26.0.0, 27.2.0).
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#releaseUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-location:[10.2.1, 12.1.0).
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#releaseUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-base:[10.2.1, 12.1.0).
Show Details
Affected Modules: app
While inspecting dependancies I found OneSignal implementation 'com.onesignal:OneSignal:3.10.6' was throwing above errors for ex.
> Could not resolve com.google.android.gms:play-services-location:[15.0.0, 16.0.0).
Required by:
project :app > com.onesignal:OneSignal:3.10.6
> Failed to list versions for com.google.android.gms:play-services-location.
> Unable to load Maven meta-data from https://s3-ap-southeast-1.amazonaws.com/jp-build-packages/ec-android-sdk/com/google/android/gms/play-services-location/maven-metadata.xml.
> Could not get resource 'https://s3-ap-southeast-1.amazonaws.com/jp-build-packages/ec-android-sdk/com/google/android/gms/play-services-location/maven-metadata.xml'.
Now coming to https://s3-ap-southeast-1.amazonaws.com/jp-build-packages/ec-android-sdk is used to fetch the dependencies required for JustPay integration.
Problem
Why wrong repository is used when resolving above dependancies for compiling the project? Am I doing something wrong or something has changed in gradle 3.3 which is causing this? Or its an issue of gradle 3.3.1?
Solution : Excluding this libs does solves the problem.
implementation ('com.onesignal:OneSignal:3.10.6') {
exclude group : 'com.google.android.gms'
exclude group : 'com.android.support'
exclude group : 'com.google.firebase'
}
I am not sure, It may have adverse affects though(If any please do let me know). But I want to get to the root of the problem I want to know why this is only happening for Android Gradle plugin 3.3.1 and the same works just fine with Android Gradle plugin 3.2.1 i.e. without excluding this dependancies.
Here is my app/build.gradle file
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath "io.fabric.tools:gradle:$rootProject.fabricGradle"
}
repositories {
maven { url 'https://plugins.gradle.org/m2/'}
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.1'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'
apply plugin: 'project-report'
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
maven { url 'https://maven.fabric.io/public' }
maven {
url 'https://maven.google.com'
}
maven {
url 'https://github.com/uPhyca/stetho-realm/raw/master/maven-repo'
}
maven {
url 'https://s3-ap-southeast-1.amazonaws.com/jp-build-packages/ec-android-sdk'
}
maven {
url 'https://s3-ap-southeast-1.amazonaws.com/godel-release/godel/'
}
}
android {
....
....
}
dependencies {
...
implementation 'com.onesignal:OneSignal:3.10.6'
...
}
build.gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.21'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1
classpath 'com.google.gms:google-services:4.2.0'
classpath "io.realm:realm-gradle-plugin:5.8.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
ext {
...
}
Update : I know it has something to do with Improved classpath synchronization which is introduced in 3.3, but still have no clue why is it trying to resolve those dependencies with wrong repository.
Update 2
I have tried following as well
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/'}
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.11.0, 0.99.99]'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
maven { url 'https://maven.google.com' }
}
dependencies {
implementation 'com.onesignal:OneSignal:[3.9.1, 3.99.99]' //as well ) at the end
}
Can you please try this:
Go to File -> Settings -> Build, Execution, Deployment -> Gradle ->
And uncheck "Offline work" option.
Update:
Remove below line of code
classpath 'com.google.gms:google-services:4.2.0'
from top-level build.gradle file sync and check it once.

Adding realtime database to my app on android studio - Failed to resolve: firebase-database-15.0.0

i've been working with firebase to access an activity on my project. Everything works fine, no compilation errors. However after i go to tools > firebase i can connect to my app easily, however when i try to click Add Real time database it shows me this:
build.gradle will include these new dependencies:
compile 'com.google.firebase:firebase-database:16.0.1:15.0.0'
Since compile is deprecated i use implementation, and when i do
Implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'
i get the following error Failed to resolve: firebase-database-15.0.0
and my sync fails.
Change Root Gradle to
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:4.0.1' // google-services plugin
}
}
allprojects {
// ...
repositories {
// ...
google() // Google's Maven repository
}
}
And App Gradle To
apply plugin: 'com.android.application'
android {
// ...
}
dependencies {
// ...
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
// Getting a "Could not find" error? Make sure you have
// added the Google maven respository to your root build.gradle
}
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
Hope This May Help You
add jcenter() in your project-level gradle.
allprojects {
repositories {
google()
jcenter()
}
}
and keep remaining as #Tomin B said.

Can't add Firebase to LibGDX project

I was trying to add Realtime Database to my LibGDX project through the Android Studio Assistant, but it gives errors on the gradle file on the second step "Add the Realtime Database to your app". It says "Dependencies set up correctly" but then it don't compile, just say "sync failed" with "Gradle DSL method not found: 'implementation()'"
android > build.gradle:
apply plugin: 'com.google.gms.google-services'
dependencies {
implementation 'com.google.firebase:firebase-database:11.8.0'
}
build.gradle:
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.google.gms:google-services:4.0.0'
}
}
(Those are only the script parts that were changed)

Add a dependency to gradle.build from CLI

many dependency management tools have very convenient cli helpers for saving new dependencies in the configuration files.
For instance, npm install --save express will save the info about express dependency to the project's package.json file.
I wonder if there is an equivalent in the gradle world? In particular, I'm looking for a way to add fabric dependency to my build.gradle from cli.
Here the changes that needs to be done to my build.gradle:
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.+'
// The Fabric Gradle plugin uses an open ended version to react
// quickly to Android tooling updates
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
//Put Fabric plugin after Android plugin
apply plugin: 'io.fabric'
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}

Android Support Library Setup error

I followed instruction from http://developer.android.com/tools/support-library/setup.html to add the support library to my android project, but got an build error like this
Gradle: A problem occurred evaluating project ':projectname'.
No signature of method: org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.compile() is applicable for argument types: (java.lang.String) values: [com.android.support:appcompat-v7:18.0.+]
Possible solutions: module(java.lang.Object)
Does anyone know the reason for that? Is it a syntax error in gradle? Below is a piece of code in my build.gradle.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
compile 'com.android.support:appcompat-v7:18.0.+'
}
}
This should be like this:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
// this is for Gradle build system so it finds
// android plugin used below
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
dependencies {
compile 'com.android.support:appcompat-v7:18.0.+'
// this is for your application
}
Don't forget to install Android Support Repository in Android SDK Manager.

Categories

Resources