1

I am trying to use the dx.Jar tool of andorid to compile the wechat-SDKandroid-with-mta-5.1.6.Jar into dex file and put it into my project.

But I encountered the following warning:

warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.tencent.mm.opensdk.diffdev.a.c) 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.

I've tried multiple versions of the dx.jar tool (1.16,1.7), and also used -- optimize, no-strict, keep-classes commands

java -jar dx.jar --dex --output=\JavaTempPath\classes.dex \wechat-sdk-android-with-mta-5.1.6.jar

or

java -jar dx.jar --dex --no-optimize --no-strict --keep-classes --output=\JavaTempPath\classes.dex \wechat-sdk-android-with-mta-5.1.6.jar

Please note that I'm not using the android studio tool for packaging, I'm just using the dx.jar tool directly, so I can't add an instruction like -keepattributes EnclosingMethod to the proguard file to sort it out, what I'm asking is is there any similar option in the dx.jar

lelloman
  • 13,883
  • 5
  • 63
  • 85
Kisence
  • 11
  • 2
  • It's just a warning, feel free to ignore it :) – JesusFreke May 22 '19 at 08:28
  • Really? He said the reflection on this class is going to be a problem, is there an option for me to ignore this warning – Kisence May 22 '19 at 09:23
  • Only one very specific aspect of reflection is affected. If your app's code does not use or rely on Class.getEnclosingClass and Class.getEnclosingMethod, then you can ignore the warning. Unless you're doing something very ususual, your app almost certainly doesn't use or rely on these methods. – JesusFreke May 22 '19 at 18:24
  • Thanks, because I'm using the SDK, I don't know if it's available anywhere in the SDK – Kisence May 23 '19 at 02:03
  • I ignored the warning and it worked:) – Kisence May 24 '19 at 03:06

0 Answers0