title: How can I tell multidex to keep a jar properties file?
body: <p>I have an issue which I'm pretty sure is related to <code>multidex</code>. Basically one of the libraries I use has a <code>.properties</code>  resource bundle in a jar. As my application started growing I started having issues with it. I've made a couple of posts about it in the past but never had any solutions (<a href="https://stackoverflow.com/questions/47227332/java-util-missingresourceexception-cant-find-bundle-for-base-name-javax-servle">post 1</a>, <a href="https://stackoverflow.com/questions/47930299/multidex-app-cant-find-jar-resource-but-only-on-some-phones">post 2</a>). Post 2 actually has a lot more details about the issue. </p>
  
  <p>Basically this resource is missing unless I force some of the code on that Jar to run on the <code>Application</code> <code>onCreate</code> method. At least that was the issue until yesterday.  </p>
  
  <p><a href="https://i.stack.imgur.com/YbAxD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YbAxD.png" alt="enter image description here"></a> </p>
  
  <p>Yesterday I update a jar that has nothing to do with this but is now larger than it used to be (which I'm assuming means it has more methods), and now the code fails again on this same issue <code>java.util.MissingResourceException: Can't find bundle for base name javax.servlet.LocalStrings, locale en_US</code> but now it fails for everyone, not just some users. </p>
  
  <p>I took apart the apks using apktool for one that works and one that doesn't (basically downgrading those unrelated jars) and there is an <code>unknown</code> folder in both apks but the one that works has those <code>LocalStrings.properties</code> in that folder and the one that doesn't work doesn't have them in that folder. I have unzipped those unrelated jars just to make sure and they don't have that <code>javax.servlet</code> package in there and they are jars so they don't have anything else that might affect the gradle build. </p>
  
  <p>Basically my theory right now is that those jars are just large enough to push the <code>javax.servlet</code> stuff out of the first dex file, but that isn't entirely right because the <code>properties</code> files don't even go in the dex file. If I just unzip the apk, I can see the <code>javax</code> package on the root folder and the resource files inside the right place but not <code>LocalStrings.properties</code> whereas if I do that for an apk that works, I can see <code>LocalStrings.properties</code> in there. </p>
  
  <p>Right now I've been testing <code>multiDexKeepProguard</code> and I got all <code>javax.servlet</code> to go in the main dex file but I still can't get <code>LocalStrings.properties</code> to show up in the apk, even with:</p>
  
  <p><code>
  -keepclassmembers class **$Properties
  </code></p>
  
  <p>I've also tried a few other crazy things like putting the <code>LocalStrings.properties</code> files inside my main app package using the <code>javax.servlet</code> package and it didn't help either. </p>
  
  <p>So what else can I try? Is this a bug or am I doing something wrong? </p>
  
  <p>Thanks. </p>
  
  <p>Edit: I would like to report that I've once again gotten past this issue by removing a dependency (an ad network) that I'm no longer using. I realized I still had that dependency when I used dex2smali to look at the first dex file and saw it was there. So it definitely appears to be an issue with the size of the jars it puts on the first dex file. </p>
  
  <p>Edit: I have this on my proguard settings:</p>
  
  <pre><code>-keep class javax.** {*;}
  -keep interface javax.** {*;}
  -keepclassmembers class javax.** {*;}
  -keepclassmembers class **$Properties
  </code></pre>