如何将库的固定版本实现到我的Android Studio项目中?

huangapple go评论81阅读模式
英文:

How to implement fixed version of library to my Android studio project?

问题

This library contains 1 bug.

It was fixed here: https://github.com/heinrichreimer/material-intro/pull/287

What is the simplest way to implement this fixed version of the library to my Android studio project? I'm new to using libraries from GitHub, I'd appreciate some help on this.

I'm currently using this: implementation 'com.heinrichreimersoftware:material-intro:2.0.0'

英文:

This library contains 1 bug.

It was fixed here: https://github.com/heinrichreimer/material-intro/pull/287

What is the simplest way to implement this fixed version of the library to my Android studio project? I'm new to using libraries from GitHub, I'd appreciate some help on this.

I'm currently using this: implementation 'com.heinrichreimersoftware:material-intro:2.0.0'

答案1

得分: 3

你有几个选项:

  1. 等待/询问所有者发布新版本并使用它。

  2. 分叉(Fork)这个项目,然后发布你自己的版本。

  3. 下载这个库并将其作为依赖项导入你的项目。

我在这里解释第三个选项:

  • 前往 https://github.com/heinrichreimer/material-intro
  • 点击 Code 按钮并下载 ZIP 文件。
  • 打开 ZIP 文件,然后打开 material-intro-master 文件夹。
  • 将库文件夹重命名为 material-intro-library
  • 在 Android Studio 中打开你的项目。
  • 转到 File > New > Import module...,然后选择 material-intro-library 文件夹。
  • 最后,打开你的 build.gradle 文件,并将 implementation 'com.heinrichreimersoftware:material-intro:2.0.0' 替换为 implementation project(path: ':material-intro-library')
英文:

You have several options:

  1. Wait for/Ask the owner to release a new version and use it.

  2. Fork the project and release one version of your own.

  3. Download the library and import it in your project as a dependency.

I'll explain here the third option:

  • Go to https://github.com/heinrichreimer/material-intro.
  • Click the Code button and Download ZIP.
  • Open the ZIP file and open the material-intro-master folder.
  • Rename the library folder to material-intro-library.
  • Open your project in Android Studio.
  • Go to File > New > Import module... and select the material-intro-library folder.
  • Finally, open your build.gradle file and replace implementation 'com.heinrichreimersoftware:material-intro:2.0.0' with implementation project(path: ':material-intro-library')

答案2

得分: 2

你可以将 material-intro 库克隆到你的电脑上。将 material-intro/lib 文件夹放置在你的项目根目录路径下。

在你的 settings.gradle 中添加 include ':library'

在你的应用级别 build.gradle 中添加 implementation project(':library')

英文:

You can clone material-intro library to your pc. Place the material-intro/lib folder to your project root directory path.

add include ':library' to your setings.gradl

add implementation project(':library') to your app-level build.gradle

答案3

得分: 2

你可以使用JitPack.io,它就像Maven一样充当库的存储库,还可以在GitHub上使用Gradle编译所需提交中(在拉取请求中找到),并在项目中使用编译后的Android或Java库,无需等待、克隆、导入,甚至无需在本地计算机上进行编译,所有操作都由JitPack.io完成并覆盖。以下是操作步骤(从网站中获取):

步骤1. 将JitPack存储库添加到您的构建文件中

在根目录的build.gradle文件末尾添加:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

步骤2. 添加依赖项

dependencies {
        implementation 'com.github.heinrichreimer:material-intro:b35d1c9d65'
}
英文:

You could use JitPack.io which acts as a repository for libraries just like maven and also to compile any Android or Java library using Gradle on GitHub at the required commit (found in the the pull request) and use the compiled library in your project in two steps. No need for waiting, cloning, importing or even compiling on your local PC, all done and covered by JitPack.io. Here are the the steps (retrieved from website):

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Step 2. Add the dependency

dependencies {
        implementation 'com.github.heinrichreimer:material-intro:b35d1c9d65'
}

答案4

得分: -1

你可以使用 JitPack.io,它类似于 Maven,是一个用于存储库的平台,还可以在 GitHub 上的所需提交处使用 Gradle 编译任何 Android 或 Java 库。

步骤 1. 将 JitPack 存储库添加到你的构建文件中
步骤 2. 添加依赖项

英文:

You could use JitPack.io which acts as a repository for libraries just like maven and also to compile any Android or Java library using Gradle on GitHub at the required commit.

Step 1. Add the JitPack repository to your build file
Step 2. Add the dependency

huangapple
  • 本文由 发表于 2020年9月14日 17:19:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/63881474.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定