【问题标题】:Supplied String module notation 'libs/dagger-1.2.2.jar' is invalid提供的字符串模块符号“libs/dagger-1.2.2.jar”无效
【发布时间】:2018-05-07 16:29:12
【问题描述】:

我正在尝试让 Mobile GTS 的预构建 Candy Jump 应用程序在 Android Studio 中运行和构建 APK。我已经准确地关注了这个视频:https://www.youtube.com/watch?v=YpYVdJVYWg0

但是,我使用的是 Gradle 4.7、JDK 1.8.0、Android 插件版本 3.1.2 和构建工具版本 27.0.3。我不确定这是否与我无法构建它的原因有什么关系,但我有一个又一个错误,我把它归结为我希望是最后一个错误。

提供的字符串模块符号“libs/dagger-1.2.2.jar”无效。示例符号:'org.gradle:gradle-core:2.2'、'org.mockito:mockito-core:1.9.5:javadoc'。

我该如何解决这个错误?

这是我的 build.gradle(模块:app)

apply plugin: 'com.android.application'

    android {
        compileSdkVersion 27
        buildToolsVersion '27.0.3'
        defaultConfig {
            applicationId "net.mobilegts.candyjump"
            minSdkVersion 19
            targetSdkVersion 27
            multiDexEnabled true

            ndk {
                moduleName "player_shared"
            }
        }
        buildTypes {
            release {
                minifyEnabled false
                shrinkResources false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            }


        }
        sourceSets.main {
            jni.srcDirs = []// <-- disable automatic ndk-build call
        }
        productFlavors {
        }
    }

dependencies {
    implementation('com.google.android.gms:play-services:+') { exclude module: 'support-v4' }
    implementation 'libs/dagger-1.2.2.jar'
    implementation 'libs/javax.inject-1.jar'
    implementation 'libs/nineoldandroids-2.4.0.jar'
    implementation 'libs/support-v4-19.0.1.jar'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.support:support-core-utils:27.1.1'
}

【问题讨论】:

    标签: android gradle


    【解决方案1】:

    您应该对 jar 文件使用“实现文件”。试试下面的代码:

    implementation files('libs/dagger-1.2.2.jar')
    implementation files('libs/javax.inject-1.jar')
    implementation files('libs/nineoldandroids-2.4.0.jar')
    implementation files('libs/support-v4-19.0.1.jar')
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-11-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-24
      • 1970-01-01
      • 2014-07-15
      相关资源
      最近更新 更多