【问题标题】:Could not find :projA:. Required by: project :app找不到:projA:。要求:项目:app
【发布时间】:2020-12-22 14:45:37
【问题描述】:

我正在尝试运行我的应用程序,但此错误出现在我的终端中。我之前在使用 SDK 时遇到了一些问题,我正在更改 build.gradle 文件。

apply plugin: 'com.android.application'

android {
    compileSdkVersion rootProject.findProperty("android.compileSdkVersion") as Integer
    defaultConfig {
        targetSdkVersion findProperty("android.targetSdkVersion") as Integer
        minSdkVersion findProperty("android.minSdkVersion") as Integer
        applicationId findProperty("android.applicationId")
        versionCode findProperty("android.minSdkVersion") as Integer
        versionName findProperty("android.versionName")


        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

        buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    }}

dependencies {
    implementation 'com.android.support:appcompat-v7:30.0.0'
    implementation(name:'projA', ext:'aar')
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

如果你有什么建议,我能做什么,请帮助我。

【问题讨论】:

  • implementation(name:'projA', ext:'aar') 应该从哪里解决这个依赖关系?
  • 来自 build.gradle 文件
  • 不,需要在(待配置的)存储库中的某处有一个文件projA.aar 才能完成这项工作。这可能是另一个项目构建的输出?

标签: java android android-studio development-environment


【解决方案1】:

你的代码问题是这一行

    implementation(name:'projA', ext:'aar')

现在这要求 gradle 查找具有 aar 扩展名的库。通常它位于位于 your_project_folder/app/libs/projA.aar 的 libs 文件夹中。如果您确定需要这个名为projA 的依赖项,请将其放在上面提到的目录中。或者,如果您不需要它,请删除该行并 gradle 同步它。

【讨论】:

  • 我已经通过重装包解决了,不过还是谢谢你的回答。
猜你喜欢
  • 2021-02-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-08-23
  • 2020-05-19
  • 2021-01-25
  • 2011-12-07
相关资源
最近更新 更多