title: "Native TF methods not found" when importing own libandroid_tensorflow_inference_java.jar
body: <p>For one of our model, I need to build a custom version of TensorFlow to import in our app. The default one doesn't contain certain needed files.</p>
  
  <p>I followed this issue in the TensorFlow repository <a href="https://github.com/tensorflow/tensorflow/issues/10153" rel="nofollow noreferrer">#10153</a> where some were confronted with the same issue that I have. They seems to  have figured how to successfully create and import a custom TensorFlow from the source.</p>
  
  <p>So far I successfully created the <code>libtensorflow_inference.so</code> and <code>libandroid_tensorflow_inference_java.jar</code> files. But when I run the app and load my model I get this error:</p>
  
  <pre><code>FATAL EXCEPTION: main
   Process: org.tensorflow.demo, PID: 23980
   java.lang.RuntimeException: Unable to start activity ComponentInfo{org.tensorflow.demo/org.tensorflow.demo.ClassifierActivity}: java.lang.RuntimeException: Native TF methods not found; check that the correct native libraries are present in the APK.
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
       at android.app.ActivityThread.-wrap11(Unknown Source:0)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
       at android.os.Handler.dispatchMessage(Handler.java:105)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6541)
       at java.lang.reflect.Method.invoke(Native Method)
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
    Caused by: java.lang.RuntimeException: Native TF methods not found; check that the correct native libraries are present in the APK.
       at org.tensorflow.contrib.android.TensorFlowInferenceInterface.prepareNativeRuntime(TensorFlowInferenceInterface.java:534)
       at org.tensorflow.contrib.android.TensorFlowInferenceInterface.&lt;init&gt;(TensorFlowInferenceInterface.java:60)
       at org.tensorflow.demo.models.Classifier.&lt;init&gt;(Classifier.java:80)
       at org.tensorflow.demo.models.yolo.YoloClassifier.&lt;init&gt;(YoloClassifier.java:30)
       at org.tensorflow.demo.ClassifierActivity.start(ClassifierActivity.java:269)
       at org.tensorflow.demo.ClassifierActivity.onCreate(ClassifierActivity.java:155)
  </code></pre>
  
  <p>I put the .jar in the <code>libs</code> folder and add it as a dependency in my build.gradle as such 
  <code>compile files('libs/libandroid_tensorflow_inference_java.jar')</code></p>
  
  <p>I also added the <code>libtensorflow_inference.so</code> in the `armeavi-v7a' folder (and made sure to run it on a device with this cpu architecture)</p>
  
  <p>I tried replacing my .jar and .so with the ones available in the nightly TensorFlow build <a href="https://ci.tensorflow.org/view/Nightly/job/nightly-android/lastStableBuild/artifact/out/" rel="nofollow noreferrer">here</a> and had the same error. So I guess this exception is related to the import, what steps should I follow to properly integrate a custom/external TensorFlow build as a dependency?</p>