我正在使用 Android studio,我想将我的 kotlin/java 项目的一部分转换为库。我将使用 Gradle 来获取源代码,如此处所述。除非我将使用具有 ssh 访问权限的私有 git 存储库。
我创建了新的没有密码的 ssh 密钥对并对其进行了测试,直接使用时 evthing 工作正常。
我在我的settings.gradle:
sourceControl {
gitRepository('ssh://git@example-vcs/username/my-private-lib.git') {
producesModule('com.example:my-private-lib')
}
}
Run Code Online (Sandbox Code Playgroud)
由于com.jcraft.jsch.JSchException: Auth fail. 它说Could not locate branch 'release'虽然它确实存在。
这是完整的堆栈跟踪:
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':distTar'.
> Could not resolve all dependencies for configuration ':runtimeClasspath'.
> Could not locate branch 'release' for Git repository at ssh://git@example-vcs/username/my-private-lib.git.
* …Run Code Online (Sandbox Code Playgroud)