简体   繁体   中英

how to add this library to my project?

link I want add the dfu library to my project. it has a download oètopn, but there is no direct download and it says to use Gradle to add it.
Anyway, the documentation says to do this step.

Clone the project, or just the DFULibrary folder (using sparse-checkout) to a temporary location.

Copy the DFULibrary folder to your projects root, for example to AndroidstudioProjects.

Add the dfu module to your project:

Add '..:DFULibrary:dfu' to the settings.gradle file: include ':app', '..:DFULibrary:dfu'

Open Project Structure -> Modules -> app -> Dependencies tab and add dfu module dependency. You may also edit the build.gradle file in your app module manually by adding the following dependency: compile project(':..:DFULibrary:dfu')

But I can't find the DFULibrary folder in this project .

Add in your build.gradle

dependencies {
    compile 'no.nordicsemi.android:dfu:1.0.4'
}

I started using it today. It is a bit different.

Use menu File -> Project Structure -> Modules.

在此处输入图片说明

Click to choose library dependency在此处输入图片说明

Search the library that you want to add in your project and click on to import. 在此处输入图片说明

dependencies {
    compile "com.android.support:appcompat-v7:28.0.0"
}

Hope this will help you enough.

Go to http://gradleplease.appspot.com/ and search for the library you want.

Go to build.gradle file and add it under dependencies{...} module and add that line and hit the sync button

dependencies {
    compile 'no.nordicsemi.android:dfu:0.6'
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM