IT story

Jar Mismatch 종속성 목록에서 android-support-v4.jar의 2 가지 버전을 찾았습니다.

hot-time 2020. 7. 1. 07:51
반응형

Jar Mismatch 종속성 목록에서 android-support-v4.jar의 2 가지 버전을 찾았습니다.


2 가지 버전의 Android 앱 (무료 / 유료)을 만들려고합니다. 둘 다 공통 파일이 포함 된 Android 라이브러리가 있습니다. 새 Android 프로젝트를 만들고 라이브러리를 사용하려고하는데 아래 오류가 발생합니다.

Found 2 versions of android-support-v4.jar in the dependency list,
but not all the versions are identical (check is based on SHA-1 only at this time).
All versions of the libraries must be the same at this time.
Versions found are:
Path: /Users/Zaheer/Developer/App Free/libs/android-support-v4.jar
    Length: 349252
    SHA-1: 612846c9857077a039b533718f72db3bc041d389
Path: /Users/Zaheer/Developer/App Library/libs/android-support-v4.jar
    Length: 337562
    SHA-1: 27c24d26e4c5d57976e6926367985548678e913c

이 문제를 해결하는 방법에 대한 아이디어가 있습니까? 나는 성공하지 못한 빌드 길을 가지고 놀고 있습니다.


이 문제를 해결하는 방법에 대한 아이디어가 있습니까?

하나를 삭제하십시오.

나는 성공하지 못한 빌드 길을 가지고 놀고 있습니다.

1 단계 : 모든 작업을 취소하십시오. Eclipse 용 ADT 플러그인의 R16 이상 버전에서 빌드 경로가 엉망이라면 잘못하고있는 것입니다.

2 단계 : JAR의 두 버전 중 하나를 선택하거나 SDK 설치의 "extras"영역에서 하나를 선택하십시오.

3 단계 : 올바른 JAR을에 넣습니다 App Library.

단계 # 4 :에서 App FreeJAR 파일을 가져 오기 때문에 에서 하나를 삭제하십시오 App Library.

두 지점 ( App FreeApp Library) 에 동일한 실제 JAR 파일을 대신 사용할 수 있지만 아무 이유없이 추가 공간을 차지합니다.


  1. 앱 무료에서 android-support-v4.jar 삭제
  2. App Library에서 App Free로 동일한 파일 추가

위의 솔루션은 대부분 문제를 해결합니다. 이러한 솔루션을 사용한 후에도 문제가 지속됩니다. 그때

프로젝트 폴더-> libs->로 이동하여 "android-support-v4.jar"을 삭제하십시오.

내 문제가 해결되어 문제가 해결되기를 바랐습니다.


및 빌드 경로 android-support-v4.jar여러 개의 라이브러리 프로젝트가 있고 libs프로젝트가 두 프로젝트 모두에 종속 되는 시나리오 가 있습니다. 예를 들어 내 경우에는 작업 공간에 다음 라이브러리 프로젝트가 있습니다.

  • libfacebook
  • libsherlockactionbar

이 두 프로젝트는 독립적이며 project.properties다음과 같습니다.

# Project target.
target=android-17
android.library.reference.1=../libfacebook
android.library.reference.2=../libsherlockactionbar

프로젝트를 빌드하면 동일한 파일의 두 복사본에 대한 중복 참조가있는 jar 불일치 문제가 발생합니다. 이 문제를 해결하기 위해 한 것은 약간의 속임수입니다. 및을 포함하여 내 작업 공간 libcommons의 다른 모든 라이브러리 프로젝트에 대한 부모 라는 새 라이브러리 프로젝트를 만들었습니다 . 그런 다음 다른 모든 프로젝트에서 지원 라이브러리를 제거하고 libs 폴더 안에 사본 하나만 보관했습니다 . 그런 다음 다른 모든 라이브러리 프로젝트에 대한 참조로 추가 했습니다. 작업 공간을 정리하면 모든 것이 매력처럼 작동합니다.libfacebooklibsherlockactionbarlibcommonslibcommons


이것은 파일을 삭제하고 추가하는 것보다 더 우아한 수정입니다!

당신은 단지해야합니다 :

  1. 프로젝트 앱을 마우스 오른쪽 버튼으로 클릭하십시오.
  2. "Android 도구"> "지원 라이브러리 추가"로 이동
  3. 권한을 승인하고 라이브러리를 업데이트하도록합니다
  4. 프로젝트 App Library에 대해이 프로세스를 반복하십시오.

그러면 Android 지원 라이브러리가 동기화됩니다 (:


매우 간단한 솔루션

매우 간단한 해결책은 제 경우에 효과적이었습니다. 동일한 (android-support-v4.jar) jar 파일을 모든 프로젝트에 복사하십시오. 더 이상 갈등이 없습니다.

1 jar 파일 android-support-v4.jar을 프로젝트의 libs 폴더에서 복사하십시오.

2 이미 존재하는 두 번째 프로젝트의 libs 폴더에서 jar 파일 android-support-v4.jar을 삭제합니다.

3 첫 번째 프로젝트의 새로 복사 된 jar 파일을 두 번째 프로젝트의 libs 폴더에 붙여 넣습니다.

jar 불일치 문제는 이제 해결 될 것입니다.


라이브러리를 프로젝트 중 하나에서 다른 프로젝트로 복사하십시오. 타임 스탬프가 둘 다 동일해야 할 수도 있습니다.


해결:

  1. Right click on 'free' project > Android Tools > Add Support Library.
  2. Do the same thing on 'paid' project.
  3. Clean all projects

Check if there are irrelevant projects open for you, because that was the case for me, it seemed one of the JAR files was related to a different project, which I wasn't working with, so I just closed that project, did a clean build of the project I'm working on and didn't have the problem anymore! Hope this helps someone!


Use same jar while adding external jars in both library and project


well.. it works for me:

Go to

Project folder > libs

then, delete "android-support-v4.jar"

Then

project > Clean

It will work!


I just had this issue, but instead of deleting the conflicting android-support-v4.jar I just renamed it to android-support-v4_PROJECT.jar, which removed the conflict.

If you are wondering how to rename a file in Eclipse, you just need to highlight the file and press F2.


You just need to have exactly the same android-support-v4.jar checksum on each of your projects. For this, you can copy/past one of them in all of your conflicting projects / library.

Nothing else to do, clean and enjoy :)


May be you open 2 project same time (both using android-support-v4.jar) . I close 1 project and every thing ok

참고URL : https://stackoverflow.com/questions/12045568/jar-mismatch-found-2-versions-of-android-support-v4-jar-in-the-dependency-list

반응형