gpt4 book ai didi

android - 由于缺少依赖项,Twitter Fabric 无法在 Android Studio 中安装

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:52:49 25 4
gpt4 key购买 nike

我正在使用 Fabric 设置一个 Cordova 项目以支持使用 Twitter 登录。我刚刚将 Fabric 插件安装到 Android Studio 中,但是当我同步 Gradle 文件时出现以下错误:

Information:Gradle tasks [:generateDebugSources, :generateDebugTestSources]
Error:A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugCompile'.
> Could not find com.squareup.picasso:picasso:2.3.2.
Searched in the following locations:
https://maven.fabric.io/public/com/squareup/picasso/picasso/2.3.2/picasso-2.3.2.pom
https://maven.fabric.io/public/com/squareup/picasso/picasso/2.3.2/picasso-2.3.2.jar
Required by:
:android:unspecified > com.twitter.sdk.android:twitter:1.1.1 > com.twitter.sdk.android:tweet-ui:1.0.3
> Could not find com.android.support:support-v4:21.0.0.
Searched in the following locations:
https://maven.fabric.io/public/com/android/support/support-v4/21.0.0/support-v4-21.0.0.pom
https://maven.fabric.io/public/com/android/support/support-v4/21.0.0/support-v4-21.0.0.jar
Required by:
:android:unspecified > com.twitter.sdk.android:twitter:1.1.1 > com.twitter.sdk.android:tweet-ui:1.0.3
> Could not find com.squareup.retrofit:retrofit:1.6.1.
Searched in the following locations:
https://maven.fabric.io/public/com/squareup/retrofit/retrofit/1.6.1/retrofit-1.6.1.pom
https://maven.fabric.io/public/com/squareup/retrofit/retrofit/1.6.1/retrofit-1.6.1.jar
Required by:
:android:unspecified > com.twitter.sdk.android:twitter:1.1.1 > com.twitter.sdk.android:twitter-core:1.1.1
> Could not find com.google.code.gson:gson:2.2.4.
Searched in the following locations:
https://maven.fabric.io/public/com/google/code/gson/gson/2.2.4/gson-2.2.4.pom
https://maven.fabric.io/public/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar
Required by:
:android:unspecified > com.twitter.sdk.android:twitter:1.1.1 > com.twitter.sdk.android:twitter-core:1.1.1

Android SDK 更新程序为我提供了支持库 21.0.3 而不是 21.0.0,正如来自 Fabric 的 Hemal 在此处所建议的:Android Twitter Fabric SDK conflict with support library

不过,我对其他那些库一无所知。有什么想法吗?

最佳答案

请遵循此代码示例以确保您的 build.gradle 文件类似:

    buildscript {
repositories {
jcenter() // <- *add this
maven { url 'https://maven.fabric.io/repo' }
}
dependencies {
classpath 'com.android.tools.build:gradle:0.13.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' // <- *make sure this is the same

//Put Fabric plugin after Android plugin
apply plugin: 'io.fabric'

repositories {
jcenter() // <- *add this
maven { url 'https://maven.fabric.io/repo' }
}

我有同样的问题,花了半天时间,直到打开推特的官方文档,看到了这个: https://dev.twitter.com/twitter-kit/android/integrate

Fabric 团队在 SO 和其他论坛上提供了太多无效的答案。这行得通。

关于android - 由于缺少依赖项,Twitter Fabric 无法在 Android Studio 中安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28113179/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com