【问题标题】:Failing To Generate APK - Getting ERROR: Failed to resolve: com.github.2359media:Easy AndroidAnimations:0.8无法生成 APK - 出现错误:无法解决:com.github.2359media:Easy AndroidAnimations:0.8
【发布时间】:2019-06-10 18:08:43
【问题描述】:

我一直在尝试从 Android Studio 3.4.1 中的已完成应用构建生成 apk。但是,它显示错误

错误:无法解决:com.github.2359media:Easy AndroidAnimations:0.8,我不确定在哪里或解决什么问题可以解决这个问题。

我看到了一个类似的问题 (Failed to resolve: com.github.PhilJay:MPAndroidChart:v2.1.4),但所有这些都已经设置好了。

我已经设置了 SDK(已经解决了将其放在名称中有空格的默认用户文件夹中的问题),以及 JDK、NDK。我还以管理员身份运行 Android Studio(甚至以管理员身份安装它)。

我也有

maven { url "https://jitpack.io" }
}

在仓库中设置

当然我的配置有误,但我不确定这个错误告诉我什么以及我需要查看的位置。

这是项目的 build.gradle:

buildscript {
    repositories {
        google()
        jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.3'

    // 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
}

对于模块:

apply plugin: 'com.android.application'

android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
    applicationId "com.alpha.calllog.myapp"
    minSdkVersion 19
    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'
    }
   }
}
repositories {
maven { url "https://jitpack.io" }
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta1'
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestImplementation 'junit:junit:4.13-beta-3'
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:gridlayout-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.googlecode.libphonenumber:libphonenumber:8.10.13'
implementation 'com.google.android.gms:play-services-ads:17.2.1'
implementation 'com.github.clans:fab:1.6.4'
implementation 'com.github.angads25:toggle:1.0.0'
implementation 'com.github.zcweng:switch-button:0.0.3@aar'
implementation 'net.igenius:customcheckbox:1.3'
implementation 'com.github.2359media:EasyAndroidAnimations:0.8'


}

Android Studio 右下角的消息说:

找不到 com.github.2359media:EasyAndroidAnimations:0.8。

在以下位置搜索: 文件:/C:/devious/tools/extras/m2repository/com/github/2359media/EasyAndroidAnimations/0.8/EasyAndroidAnimations-0.8.pom

还有很多文件在同一个目录下,但是当我在资源管理器中查看时,当然没有这样的目录。这些目录应该如何创建?我需要吗?似乎这些是通过某个过程创建的,但我不知道是哪个过程。

对我来说,这表明我没有正确配置某些内容,或者需要在代码中某处更新某些内容。

【问题讨论】:

  • 没有示例可制作。我正在经历生成apk的过程,上面的错误就是我得到的。
  • “在我开始研究它们之前,在这里寻求有关我需要查看什么的指导不会有什么坏处” 通常我们期望相反 - 在询问之前先进行研究。至少,您能否编辑您的问题以链接到您发现的类似问题?
  • 这是研究的一部分。我根本不知道去哪里找。而不是关于我应该如何提问的课程,也许你们中的任何人都可能知道我在处理什么,并且可以轻松地说:“查看这个文件并编辑 xyz 参数,因为它们负责 abc 功能/情景/情况。”我不是要求修复,而是我需要查看的内容,甚至知道在哪里进行修复。感谢您的理解。
  • 您的问题中缺少的其他内容是您的 build.gradle 文件。请按照 Zoe 链接中的说明为您的问题添加最小复制。正如我之前所问的,还请添加指向您已经找到并尝试过的问题的链接。我们不想重复您已经尝试过的事情,但除非您告诉我们,否则我们无法知道您已经尝试过什么。

标签: android-studio mobile apk


【解决方案1】:

实际上是通过从 GitGub 下载一个 jar 并添加到 libs 文件夹,然后用这个编辑模块 build.gradle 来解决这个问题 '文件('libs/easyandroidanimationslibrary-v0.5.jar')' 在依赖项下。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-09-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-28
    • 2020-09-20
    • 1970-01-01
    相关资源
    最近更新 更多