2016-11-08 5 views
4

Android Studio에서 코드를 빌드 할 때이 경고 메시지가 표시됩니다.
몇 번이나 나타나지 않지만 대부분의 시간을 보입니다.Android 경고 - InnerClasses 속성 무시 (jnamed)

-keepattributes EnclosingMethod 
-keepattributes InnerClasses 

가 도움이되지 않았다 그러나 :

warning: Ignoring InnerClasses attribute for an anonymous inner class 
(jnamed$1) that doesn't come with an 
associated EnclosingMethod attribute. This class was probably produced by a 
compiler that did not target the modern .class file format. The recommended 
solution is to recompile the class from source, using an up-to-date compiler 
and without specifying any "-target" type options. The consequence of ignoring 
this warning is that reflective operations on this class will incorrectly 
indicate that it is *not* an inner class. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(jnamed$2) that doesn't come with an 
associated EnclosingMethod attribute. This class was probably produced by a 
compiler that did not target the modern .class file format. The recommended 
solution is to recompile the class from source, using an up-to-date compiler 
and without specifying any "-target" type options. The consequence of ignoring 
this warning is that reflective operations on this class will incorrectly 
indicate that it is *not* an inner class. 
warning: Ignoring InnerClasses attribute for an anonymous inner class 
(jnamed$3) that doesn't come with an 
associated EnclosingMethod attribute. This class was probably produced by a 
compiler that did not target the modern .class file format. The recommended 
solution is to recompile the class from source, using an up-to-date compiler 
and without specifying any "-target" type options. The consequence of ignoring 
this warning is that reflective operations on this class will incorrectly 
indicate that it is *not* an inner class. 

나는 다른 문제를 읽고 내 난독 파일에 다음을 포함 시켰습니다.

편집 :

는이 문제를 해결하는 것은 불가능, 어떻게 postguard이 경고 (또는 다른 방법으로) 숨을 가르쳐주십시오. 고맙습니다!

+0

안녕하세요, 본 적이 있나요? http://stackoverflow.com/questions/30999337/android-studio-and-gradle – Jaco

+0

안녕하세요. 아니, 그게 맞지 않아. 도움이되지 않았다. 내 질문에 아래 표를 제거하여 답변을 얻을 수 있도록하십시오. 감사! –

+0

죄송합니다 György Benedek, 나는 당신에게 아래 표를 추가하지 않았습니다 – Jaco

답변

2

무엇이 문제의 원인입니까?

Android 6 런타임 Dalvik을 실행하는 JVM에서 Java 6 또는 7에 대해 컴파일되지 않은 클래스 파일을 사용하려고합니다. 큰 문제는 아니지만, 걱정할 필요가 없습니다.

어떻게 해결할 수 있습니까?

문제의 원인이되는 라이브러리를 다시 컴파일 할 수 있습니다. 불행히도, 라이브러리는 이미 컴파일 된 jar 파일에 있습니다. 소스를 온라인으로 찾아서 컴파일 해 볼 수 있습니다.

+0

나는 단지 하나의 항아리 만 사용하고 있는데, 그것은 dnsjava입니다. https://sourceforge.net/projects/dnsjava/ 문제의 원인이 될 수 있습니까? 알 수 있듯이 새로운 버전이 없습니다. 2.1.7을 이미 사용하고 있습니다. 이 경고를 숨기기 위해 포스트 가드에 가능한 옵션이 있습니까? –

+0

dnsjava의 Jnamed가 문제의 원인입니다. http://dnsjava.org/dnsjava-current/jnamed.java 소스를 보면 2004 년에 만들어 졌다고 나와 있습니다. 프로젝트에 org.xbill.DNS.programs라는 패키지를 만들고 Jnamed라는 클래스를 소스의 코드가 들어있는 패키지. 그게 문제를 해결해야합니다 –

+0

하지만, 당신은 경고의 출처를 발견했지만, 문제가 해결되지 않았다. 고마워, 너에게 현상금을 줘! :) –

2

JDK 및 JRE 업데이트를 고려 했습니까? 또한 Android Studio를 최신 버전으로 업데이트하셨습니까? 이러한 작업 중 하나를 수행하면 문제가 해결 될 수 있습니다. 또한 sdk 관리자에서 proguard를 제거하고 다시 설치하는 것이 도움이 될 수 있습니다.

+0

Android Studio가 최신 버전이며 항상 시작시 권장되는 업데이트 된 팝업을 설치합니다. 3 대의 컴퓨터에서 Android Studio를 사용하고 있는데 모두 문제가있어 아마 작동하지 않지만 시도해 보겠습니다. 감사합니다! :) –