gradle 의존성이 새로운 버전인지 확인하는 방법
Android Studio +
에서 (와 같은 com.android.support:recyclerview-v7:21.+
) 버전 번호를 사용할 때 "버전 번호에 +를 사용하지 마십시오"경고가 표시됩니다. 특정 버전 번호를 사용하면 항상 최신 버전을 사용할 수 없습니다. 내 프로젝트에 많은 의존성이 있습니다. 종속성에 최신 버전이 있는지 어떻게 확인합니까? 새로운 버전의 종속성이있을 때 알려주는 Android Studio 플러그인이 있습니까?
편집 : Android 스튜디오는 오래된 Android 지원 라이브러리 및 Google Play 서비스를 강조 표시합니다. 그러나 다른 사용자 정의 라이브러리에는 사용할 수 없습니다.
이제 Lint 점검으로 Android Studio에 내장되어 있습니다. 여기에서 활성화 할 수 있습니다 :
설정> 편집기> 검사> "최신 라이브러리 버전 사용 가능"
이 검사에 대한 설명 :
사용 가능한 최신 라이브러리 버전
이 검출기는 중앙 저장소를 검사하여이 프로젝트에서 사용하는 종속성에 사용 가능한 최신 버전이 있는지 확인합니다. 이는 Android SDK 도구 및 라이브러리에서 사용 가능한 최신 버전을 확인하는 GradleDependency 확인과 유사하지만 MavenCentral 종속성과 함께 작동하며 매번 라이브러리에 연결되므로 더 유연하지만 속도가 훨씬 느려집니다.
속도 저하로 인해 항상 켜져 있지 않고 수동으로 수동으로 실행하는 것이 좋습니다. 다음과 같이하면됩니다 :
분석> "이름 별 검사 실행"
그런 다음 "사용 가능한 최신 라이브러리 버전"을 검색하여 모듈에서 실행하십시오.
편집 : 위는 Android Studio 2.3부터 작동합니다. 이전 버전 인 경우 (업데이트해야 함) 다음이 도움이 될 수 있습니다.
수동으로 실행하려면 검사가 활성화되어 있어야하므로 (Android Studio 2.0 베타 2부터) 설정에서 검사를 찾아 활성화 한 다음 이름으로 실행 한 다음 다시 비활성화해야합니다 ( 이전 성능을 회복하려면).
업데이트 (05/23/18) :
최신 버전의 Android Studio는 프로젝트 구조 대화 상자에 버전 업데이트를 표시하지 않습니다. 대신 Adam의 답변은 Android Studio 3 이상에 대한 정답입니다.
분석> "이름 별 검사 실행"
그런 다음 " Newer Library Versions Available
"를 검색하십시오.
이전 방법 :
현재 Android Studio 2.2
새로운 Project Structure
대화 상자에는 로컬 및 원격 리포지토리의 사용 가능한 업데이트와 함께 앱이 사용하는 종속성 목록이 표시됩니다.
- 로 이동하여 활성화
Android Studio > Settings > Build, Execution, Deployment > Gradle > Experimental
하고 확인Use new Project Structure dialog
(감사 @jessehensold를) - 그런 다음
File > Project Structure > Messages
이전 버전의 Android Studio의 경우 아래의 다른 응답을 참조하십시오.
Android Studio의 기본 제공 기능 외에도 Gradle Versions Plugin 이라는 멋진 gradle 플러그인 이 있습니다. 일반 gradle 확장의 이점으로 인해 특정 IDE에 연결되지 않으므로 Gradle을 사용하는 모든 프로젝트에 유용합니다.
Gradle Versions Plugin은 사람이 읽을 수있는 일반 텍스트 형식으로 보고서를 작성할 수 있지만 자동화 된 처리를 위해 JSON 또는 XML로 덤프 할 수도 있습니다.
Once added to your gradle file, standard usage would look more like:
> ./gradlew dependencyUpdates
This would produce project dependency report that looks like this:
------------------------------------------------------------
: Project Dependency Updates (report to plain text file)
------------------------------------------------------------
The following dependencies are using the latest milestone version:
- com.github.maksim88:PasswordEditText:v0.9
- com.android.databinding:adapters:1.3.1
- com.joanzapata.iconify:android-iconify-entypo:2.2.2
- com.joanzapata.iconify:android-iconify-fontawesome:2.2.2
- com.webnetmobile.tools:webnet-log:1.0.3
- com.nulab-inc:zxcvbn:1.2.2
The following dependencies exceed the version found at the milestone revision level:
- com.hannesdorfmann.fragmentargs:annotation [4.0.0-SNAPSHOT <- 3.0.2]
- com.hannesdorfmann.fragmentargs:bundler-parceler [4.0.0-SNAPSHOT <- 3.0.2]
- com.github.bumptech.glide:glide [3.7.0 <- 3.6.1]
- com.hannesdorfmann.fragmentargs:processor [4.0.0-SNAPSHOT <- 3.0.2]
The following dependencies have later milestone versions:
- com.github.PhilJay:MPAndroidChart [v2.2.5 -> v3.0.1]
- com.android.support:appcompat-v7 [25.1.0 -> 25.1.1]
- com.jakewharton:butterknife [8.4.0 -> 8.5.1]
Generated report file build/dependencyUpdates\report.txt
See docs for extensive usage examples.
NOTE: versions higher than 0.17.0 produce more output in plan text format, incl. project URLs thus making the whole output bloated. If you, as me find that useless, stick to version 0.17.0.
DEPRECATED - SEE ACCEPTED ANSWER FOR MODERN WAY
The tool I present below doesn't work on new versions of Android Studio / Gradle and its author no longer maintains it (as of 30/10/2016). Therefore, the solution presented in the accepted answer should be used unless working with old version of Android Studio.
As of January 2016, there's a plugin for Android Studio that does something similar, called Dependencies Version Checker, and whose sources can be found on GitHub.
It can be added through the built-in interface (Settings > Plugins > Browse repositories...) :
After installation and restart, the following tab appears in the UI:
The relevant build.gradle
should then be pasted into the left side of the VersionChecker panel, and the Version Check button pressed. The result is a table that appears on the right side, which includes the latest versions of the libraries used in the pasted script (as shown in the image above).
See File > Project Structure, then click "Suggestions". I know, this solution was suggested by Hemant Sharma and Jeremías Gersicich, but Android Studio has changed it in 3.4.1 version.
For support library (com.android.support) dependencies, there is a better option - andle
It can query jcenter and maven center as well.
Simple three step to update all project at once.
1. install:
$ sudo pip install andle
2. set sdk:
$ andle setsdk -p <sdk_path>
3. update depedency:
$ andle update -p <project_path> [--dryrun] [--remote] [--gradle]
--dryrun: only print result in console
--remote: check version in jcenter and mavenCentral
--gradle: check gradle version
See https://github.com/Jintin/andle for more information
I was dealing with this same problem and tried the answer https://stackoverflow.com/a/35371234/6412430
What really worked for me on Android Studio 3.4.1 was:
File -> Project Structure -> Dependencies
Once you have reached this point all dependencies that are included on your project or module will be listed. The ones that are outdated will be underscored and when you select one, the details of it will be shown giving you the options to updated the Variable (if you have it separated from the declaration) or the Dependency.
Kind of late but this was what worked for me.
To get updated or recommended for your project dependency should be same as android project
FILE -> Project Structure -> MODULES(app) -> Dependencies
When you reach the dependencies tab Click on +
button which is placed on the top right corner of the window. When you click on +
Select Library Dependency
it will open New window for Choose Library Dependency
Search for your dependency in the search box, all the listed Android dependencies are updated.
참고 URL : https://stackoverflow.com/questions/28683327/how-to-check-if-gradle-dependency-has-new-version
'Programing' 카테고리의 다른 글
sh에서 'find'의 '-prune'옵션을 사용하는 방법은 무엇입니까? (0) | 2020.05.06 |
---|---|
String, StringBuffer 및 StringBuilder (0) | 2020.05.06 |
web.config 파일을 사용하여 HTTPS를 강제 실행하는 방법 (0) | 2020.05.06 |
git difftool 및 mergetool로 Meld 설정 및 사용 (0) | 2020.05.06 |
x == (x = y)가 (x = y) == x와 다른 이유는 무엇입니까? (0) | 2020.05.06 |