gpt4 book ai didi

android - 在 Android Studio 项目中添加外部项目作为依赖导致找不到文件的错误

转载 作者:行者123 更新时间:2023-11-30 01:15:58 25 4
gpt4 key购买 nike

我目前正在尝试添加 https://github.com/firebase/FirebaseUI-Android 的本地克隆作为我项目中的依赖项。我不想通过标准方式导入它,因为我想对 FirebaseUI 进行修改。目前我正在尝试这个:

settings.gradle:

include ':firebaseui'
project(':firebaseui').projectDir = new File(settingsDir, '../FirebaseUI')

我模块的 build.gradle:

dependencies {
compile project(":firebaseui")
}

但是我得到:

Error:(42, 0) Could not read script 'C:\Users\Gonzalo\AndroidStudioProjects\MyProject\common\constants.gradle' as it does not exist.

在 FirebaseUI\build.gradle 中导入:

allprojects { project ->
// Get constants, this is where we store things
// like the list of submodules or the version
project.apply from: "$rootDir/common/constants.gradle"
...

是FirebaseUI的build.gradle还是我的问题?

最佳答案

通过 mavenLocal() repo 使用二进制 dep:

  1. git clone https://github.com/firebase/FirebaseUI-Android
  2. cd FirebaseUI-Android
  3. gradlew tasks//你会看到publishToMavenLocal
  4. FirebaseUI-Android 打开到一个单独的 Intellij 实例中
  5. 做出改变
  6. 运行gradlew publishToMavenLocal
  7. 在您自己的项目中,将 mavenLocal() 添加到您的 repositories
  8. 然后添加compile 'com.firebaseui:firebase-ui:0.4.1'做你的dependencies

完成所有这些之后,您就可以开始了。

  1. 对库进行更改
  2. 通过gradlew publishToMavenLocal再次发布
  3. 重新编译你的应用

关于android - 在 Android Studio 项目中添加外部项目作为依赖导致找不到文件的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37861965/

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