title: System.loadLibrary get stuck and never returns
body: <p>Our game stalls as it loads our main library under Android with API level 15 (or 14, haven't test previous versions). <strong>This does not occur on device with API level 16 and above.</strong></p>
  
  <p>We are using the NDK so our Main.java includes the following lines at its end:</p>
  
  <pre><code>static {
      boolean bFMODReady = false;
      try {
        System.loadLibrary("fmod");
        System.loadLibrary("fmodstudio");
        bFMODReady = true;
      } catch (UnsatisfiedLinkError e) {
          Log.e(TAG, "Unable to load FMOD (" + e.getLocalizedMessage() + ")");
      }
  
      if (BuildConfig.AMAZON) {
          System.loadLibrary("AmazonGamesJni");
      }
  
      System.loadLibrary("Main");
  
      if (!bFMODReady) {
          Log.e(TAG, "FMOD is not ready -&gt; disable audio");
          disableAudio();
      }
  }
  </code></pre>
  
  <p>The game stalls at launch with the following log:</p>
  
  <pre><code>05-05 00:30:39.017 598-598/com.snip.snap D/dalvikvm: Trying to load lib /mnt/asec/com.snip.snap-1/lib/libMain.so 0x4175c7e8
  </code></pre>
  
  <p>Nothing more. According to previous logs, fmod, fmodstudio and AmazonGamesJni libraries load just fine.</p>
  
  <p>Obviously the loading of libMain.so get stuck for whatever reason. We are compiling our libraries against <code>c++_static</code> (with the <code>APP_STL</code> value from the <code>Application.mk</code> file). We also are using Proguard and multidex.</p>
  
  <p>Here are what we tried to fix the issue but failed:</p>
  
  <ul>
  <li>compile against either <code>c++_shared</code>, <code>gnustl_static</code> or <code>gnustl_shared</code>;</li>
  <li>deactivate some of the static libraries we are linking our libMain against. Since it's a very lengthy operation we did deactivate just a very few;</li>
  <li>deactivate proguard</li>
  </ul>
  
  <p>What can we do to track down the issue?</p>
  
  <p>Thanks for your help</p>
  
  <p>SO reference:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/21915274/loading-a-shared-library-with-the-system-loadlibrary-call-never-returns">Loading a shared library with the System.loadLibrary call never returns</a></li>
  <li><a href="https://stackoverflow.com/questions/32860294/android-load-library-failed">android load library failed</a></li>
  </ul>