Start a new topic

Calling SimpleIRExample from another project

Calling SimpleIRExample from another project


Solved installing new SDK version 3.0 launched yesterday (06/19/13). Now works perfectly as library in a Nexus 4 with Android 4.2.2, making some changes in the very good examples available of this version.

Hi,

 

I'm trying to integrate the SimpleIRExample as library into my project. For posting purposes, I wrote a minimal example which throws the same error as in my project.

 

The parent project 'TestIR' has to be like that (this is the MainActivity):

 

package com.example.testir;

 

import android.app.Activity;

import android.content.Context;

import android.content.Intent;

import android.os.Bundle;

import android.view.View;

import android.view.View.OnClickListener;

import android.widget.Button;

import es.wul4.ar.WikitudeAR;

 

public class MainActivity extends Activity {

 

private Context context;

 

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

 

context = this;

 

Button button1 = (Button) findViewById(R.id.button1);

 

button1.setOnClickListener(new OnClickListener() {

 

@Override

public void onClick(View v) {

Intent intent = new Intent(context, WikitudeAR.class); // HERE IS THE CALL TO WIKITUDE SIMPLEIREXAMPLE

context.startActivity(intent);

}

});

}

}

 

Parent project has this manifest: 

 


<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

    package="com.example.testir"

    android:versionCode="1"

    android:versionName="1.0" >

 

    <uses-sdk

        android:minSdkVersion="8"

        android:targetSdkVersion="17" />

 

    <uses-permission android:name="android.permission.INTERNET" />

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

<uses-permission android:name="android.permission.ACCESS_GPS" />

<uses-permission android:name="android.permission.CAMERA" />

<uses-permission android:name="android.permission.INTERNET" />

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<uses-permission android:name="android.permission.READ_PHONE_STATE"/>

    

    <application

        android:allowBackup="true"

        android:icon="@drawable/ic_launcher"

        android:label="@string/app_name"

        android:theme="@style/AppTheme" >

        <activity

            android:name="com.example.testir.MainActivity"

            android:label="@string/app_name" >

            <intent-filter>

                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />

            </intent-filter>

        </activity>

        <activity

            android:name="es.wul4.ar.WikitudeAR"

            android:screenOrientation="landscape"

  android:configChanges="screenSize|orientation">

        </activity>

    </application>

 

</manifest>

 


And here comes the problem. I add the SimpleIRExample as library project in my parent project:




Here is the libs tree for SimpleIRExample:

.

??? armeabi

?   ??? libExtensionVuforia.so

?   ??? libQCAR.so

??? armeabi-v7a

?   ??? libExtensionVuforia.so

?   ??? libQCAR.so

??? javadoc.jar

??? QCAR.jar

??? wikitudesdk.jar

 

And the <activity> section on SimpleIRExample manifest:

 


        <activity

            android:name=".WikitudeAR"

            android:label="@string/app_name"

            android:screenOrientation="landscape"

android:configChanges="screenSize|orientation"

            android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen">

            <intent-filter>

                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>

            </intent-filter>

        </activity>


 

We have no syntax nor compile errors, so run the program. A simple button of my testIR project's activity appears, and when I pushed it I've got the following errors, in a repeatedly way:


D/dalvikvm(27351): Trying to load lib /data/data/com.example.testir/libarchitect.so 0x421a9cb0

D/dalvikvm(27351): Added shared lib /data/data/com.example.testir/libarchitect.so 0x421a9cb0

A/libc(27351): Fatal signal 11 (SIGSEGV) at 0x00000010 (code=1), thread 27351 (.example.testir)

 

When I create a main activity in a not-library in a standalone project, and call the WikitudeAR Activity, it works correctly. However, if the project uses several libraries, I've got same errors as above (Fatal signal 11 SIGSEV). It's interesting for me to have SimpleIRExample as library or call in any way, because I wrote an apps container that calls several libraries or modules to make a great and diverse app.

 

Anyone has any idea? 

 

Thanks in advance!
Login or Signup to post a comment