0

I am trying to hook into the Huawei AREngine in a native renderer. the library is connected and I have managed to call a function from the API, but I cant get anything that needs the JNIEnv or context or Activity to work without throwing a SIGSEGV.

Am I missing something obvious? the pointers are showing address values which appear to be consistant from run to run. I am passing the addresses as void* which is shown in the Example app.

Thanks for any advice.

in my activity, this code:

  protected void onResume()
    {
        super.onResume();

        CloudEngine.onCreate(getApplicationContext(), this);

call into the JNI which calls into this

void HWSensor::Initialise(void* env, void* context, void* activity)
{
    HwArEnginesAvaliblity engines = HwArEnginesSelector_checkAllAvailableEngines(env, activity);
    LOGI("HelloArApplication-----jds added ---1--- OnResume(): Check_EnginesAvailability, engines=%d",
         engines);
}

I should see the available 'engines' but instead this function HwArEnginesSelector_checkAllAvailableEngines causes a fatal error.

XiaoHouZi
  • 11
  • 1
  • 5
  • Do you have a debugger? What is the address of the function? I often stumbled upon those problems when using APIs like GLEW where you have to initialize the library otherwise the functions would not have been initialized. So you may try to call a function which points to NULL – Yastanub Apr 30 '19 at 14:31
  • Yeah, the function appears to have a valid address. i think the problem must be with the vars coming through from java. – XiaoHouZi Apr 30 '19 at 14:48
  • post your error logs please – shizhen May 02 '19 at 01:08

0 Answers0