Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8511341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:57:50+00:00 2026-06-11T03:57:50+00:00

Class: package com.example.foo; public class Dummy { int value; public Dummy(int value) { this.value

  • 0

Class:

package com.example.foo;

public class Dummy
{
    int value;

    public Dummy(int value)
    {
        this.value = value;
    }   
}

JNI snippet:

jclass class = (*jni_env)->FindClass(jni_env, "com/example/foo/Dummy");
jmethodID constructor = (*jni_env)->GetMethodID(jni_env, class, "<init>", "(I)V");
jobject object = (*jni_env)->NewObject(jni_env, constructor, 0);

LogCat output:

09-03 11:02:02.937: W/dalvikvm(2179): Invalid indirect reference 0x44e9cf80 in decodeIndirectRef
09-03 11:02:02.937: E/dalvikvm(2179): VM aborting
09-03 11:02:02.937: A/libc(2179): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 2179
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T03:57:51+00:00Added an answer on June 11, 2026 at 3:57 am

    NewObject() expects the class object pointer as the second parameter. The constructor method ID is the third parameter. Reformulate like this:

    jobject object = (*jni_env)->NewObject(jni_env, class, constructor, 17); 
    

    Where 17 is the argument to the constructor.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This confuses me. The following compiles fine under Eclipse. package com.example.gotchas; public class GenericHelper1
How do I call start() below? package com.example.test; class Bar {} public class Foo<K>
My directory structure is: ABC/src/com/example/model/a.java ABC/src/com/example/web/b.java Code for a.java : package com.example.model; public class
package com.example.android.home; import android.app.Activity; import android.os.Bundle; import android.widget.*; import android.view.*; public class HomeActivity extends
I am interested in using a class file (CameraPreview.java) from this package com.example.android.apis.graphics. I
package com.example.helloandroid; import java.io.File; import android.os.AsyncTask; import android.os.Environment; import android.widget.Toast; public class CheckTask extends
If I have the following class: package com.example; import org.springframework.beans.factory.annotation.Required; public class Customer {
I have a job with name Myjob.java under package com.example.jobs . This class is
this is my custom dialog class: package com.WhosAround.Dialogs; import com.WhosAround.AppVariables; import com.WhosAround.R; import com.WhosAround.AsyncTasks.LoadUserStatus;
Please consider the following java source: package com.stackoverflow; public class CondSpeed { private static

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.