Crash when calling AAssetManager_fromJava: "JNI WARNING: instance fieldID 0x571819bc not valid"
<p>This is the full warning:</p>

<blockquote>
  <p>JNI WARNING: instance fieldID 0x571819bc not valid for class
  Ljava/lang/Class; in
  Lcom/brokenteapot/lwtemplate/JNI;.onCreate:(Landroid/content/res/AssetManager;)V
  (GetIntField)</p>
</blockquote>

<p>And the backtrace:</p>

<pre><code>#00  pc 00045dd0  /system/lib/libdvm.so (dvmAbort+75)
#01  pc 00039819  /system/lib/libdvm.so
#02  pc 0003e96b  /system/lib/libdvm.so
#03  pc 000089b9  /system/lib/libandroid.so (AAssetManager_fromJava+88)
#04  pc 00002f54  /data/data/com.brokenteapot.lwtemplate/lib/libLiveWallpaperTemplate.so (Java_com_brokenteapot_lwtemplate_JNI_onCreate+128)
</code></pre>

<p>Here is the code that's causing it:</p>

<h1>Java</h1>

<pre><code>public final class LiveWallpaperService extends WallpaperService 
{
    static AssetManager assetManager;

    @Override
    public void onCreate()
    {
        assetManager = getAssets();
        JNI.onCreate(assetManager);
    }
}
</code></pre>

<h1>C++</h1>

<pre><code>void Java_com_brokenteapot_lwtemplate_JNI_onCreate(JNIEnv* env, jobject assetManager)
{
    AAssetManager* pAssetManager = AAssetManager_fromJava(env, assetManager);
}
</code></pre>

<p>I really have no idea what that warnings means or why it's crashing. I'm following the example from the NDK samples almost exactly. Is it because it's a service that something is different?</p>
