title: Stuck on weird crash when calling GetFieldID for recovering member id of custom java class in jni
body: <p>Here is a custom java class:</p>
  <pre class="lang-java prettyprint-override"><code>package com.example.myapplication;
  
  import androidx.appcompat.app.AppCompatActivity;
  
  import android.graphics.PointF;
  import android.graphics.Rect;
  
  
  public class MainActivity extends AppCompatActivity {
  public static class FaceShape {
          public PointF [] faceProfile;
          public PointF [] leftEyebrow;
          public PointF [] rightEyebrow;
          public PointF [] leftEye;
          public PointF [] rightEye;
          public PointF [] nose;
          public PointF [] mouth;
          public PointF [] pupil;
  
          float confidence;
      }
  
      public static class TrackedFace {
          public FaceShape faceShape;
          public Rect faceRect;
  
          public int frameId;
      }
  ...
  }
  
  </code></pre>
  <p>Now I want to recover field ids for all members of <code>TrackedFace</code> in native code:</p>
  <pre class="lang-cpp prettyprint-override"><code>jclass clsTrackedFace = env-&gt;FindClass(&quot;com/example/myapplication/MainActivity$TrackedFace&quot;);
  jfieldID faceShapeId = env-&gt;GetFieldID(clsTrackedFace, &quot;faceShape&quot;, &quot;Lcom/example/myapplication/MainActivity/FaceShape;&quot;);
  jfieldID faceRectId = env-&gt;GetFieldID(clsTrackedFace, &quot;faceRect&quot;, &quot;Landroid/graphics/Rect;&quot;);
  
  </code></pre>
  <p>logcat of android studio displays following errors when running the program on devices:</p>
  <pre><code>11-05 21:47:13.232 18792-18792/com.example.myapplication E/art: JNI DETECTED ERROR IN APPLICATION: JNI GetFieldID called with pending exception 'java.lang.NoSuchFieldError' thrown in unknown throw location
  11-05 21:47:13.232 18792-18792/com.example.myapplication E/art:     in call to GetFieldID
  11-05 21:47:13.232 18792-18792/com.example.myapplication E/art:     from java.lang.String com.example.myapplication.MainActivity.stringFromJNI()
  11-05 21:47:13.232 18792-18792/com.example.myapplication E/art: &quot;main&quot; prio=5 tid=1 Runnable
  11-05 21:47:13.232 18792-18792/com.example.myapplication E/art:   | group=&quot;main&quot; sCount=0 dsCount=0 obj=0x7515afa8 self=0x7f8309a000
  11-05 21:47:13.232 18792-18792/com.example.myapplication E/art:   | sysTid=18792 nice=0 cgrp=default sched=0/0 handle=0x7f8711de30
  11-05 21:47:13.232 18792-18792/com.example.myapplication E/art:   | state=R schedstat=( 364733924 74412465 219 ) utm=31 stm=5 core=1 HZ=100
  11-05 21:47:13.232 18792-18792/com.example.myapplication E/art:   | stack=0x7ffda7a000-0x7ffda7c000 stackSize=8MB
  11-05 21:47:13.232 18792-18792/com.example.myapplication E/art:   | held mutexes= &quot;mutator lock&quot;(shared held)
  11-05 21:47:13.232 18792-18792/com.example.myapplication E/art:     at com.example.myapplication.MainActivity.stringFromJNI(Native method)
  11-05 21:47:13.232 18792-18792/com.example.myapplication E/art:     at com.example.myapplication.MainActivity.onCreate(MainActivity.java:58)
  </code></pre>
  <p>debugger helps me confirm that the exception is raised from the line:</p>
  <pre class="lang-cpp prettyprint-override"><code>jfieldID faceRectId = env-&gt;GetFieldID(clsTrackedFace, &quot;faceRect&quot;, &quot;Landroid/graphics/Rect;&quot;);
  </code></pre>
  <p>and I notice <strong>faceShapeId is NULL</strong>, So I basically can assure there are some errors for recovering field id of <code>faceShape</code> field, who can help me out?</p>