Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method addObjectsTo(World, GLFactory) must override or implement a supertype #29

Open
Ionea opened this issue Jul 16, 2014 · 7 comments

Comments

@Ionea
Copy link

Ionea commented Jul 16, 2014

Hello! I'm trying to use your library for my bachelor degree, and seem to have some issues regarding the demo that you've posted.
I'm trying to test the solar system, placed at 10m distance from the user, and I keep getting this error. If I correct the error, then this part of code:
@OverRide
public void addObjectsTo (World world, GLFactory objectFactory) {
//GeoObj o = new GeoObj();
// o.setComp(objectFactory.newArrow());
world.add(objectFactory.newSolarSystem(new Vec(10,0,0)));
}
is never used and the app isn't doing anything. The following screenshot shows what I can see on the display with the errors corrected.
screenshot_2014-07-16-13-10-50

The error I get is this:

Multiple markers at this line
- Method breakpoint:Main [entry] - addObjectsTo(World, GLFactory)
- The method addObjectsTo(World, GLFactory) of type new DefaultARSetup(){} must override or implement a supertype

I read some articles saying that it might be a compatibility issue, and to try it with compiler version 1.6 and the project build target to be Android 4.0.3. I tried this, and didn't worked. I've tried a couple more versions, and still nothing.
Could you help me regarding this issue?
Thank you!

P.S. Keep up the good work :)

@simon-heinen
Copy link
Owner

Ok since it says "The method addObjectsTo(World, GLFactory) of type new
DefaultARSetup(){} must override or implement a supertype" there must be a
problem with your anonymous subclass of DefaultARSetup. If you take a look
inside DefaultARSetup you will see that there is one abstract method, maybe
remove your addObjectsTo and check if Eclipse tells you "you have to
implement method xy in your subclass of DefaultARSetup.

Simon

On Wed, Jul 16, 2014 at 12:14 PM, Ionea [email protected] wrote:

Hello! I'm trying to use your library for my bachelor degree, and seem to
have some issues regarding the demo that you've posted.
I'm trying to test the solar system, placed at 10m distance from the user,
and I keep getting this error. If I correct the error, then this part of
code:
@OverRide https://github.com/Override
public void addObjectsTo (World world, GLFactory objectFactory) {
//GeoObj o = new GeoObj();
// o.setComp(objectFactory.newArrow());
world.add(objectFactory.newSolarSystem(new Vec(10,0,0)));
}
is never used and the app isn't doing anything. The following screenshot
shows what I can see on the display with the errors corrected.
[image: screenshot_2014-07-16-13-10-50]
https://cloud.githubusercontent.com/assets/8178963/3597450/e971e5b4-0cd1-11e4-8bcc-fd33732cd1fb.png

The error I get is this:

Multiple markers at this line

  • Method breakpoint:Main [entry] - addObjectsTo(World, GLFactory)
  • The method addObjectsTo(World, GLFactory) of type new DefaultARSetup(){}
    must override or implement a supertype

I read some articles saying that it might be a compatibility issue, and to
try it with compiler version 1.6 and the project build target to be Android
4.0.3. I tried this, and didn't worked. I've tried a couple more versions,
and still nothing.
Could you help me regarding this issue?
Thank you!

P.S. Keep up the good work :)


Reply to this email directly or view it on GitHub
https://github.com/bitstars/droidar/issues/29.

@Ionea
Copy link
Author

Ionea commented Aug 18, 2014

Hi, Simon.
Sorry for the big delay, but I finally managed to get back to work and solved the previous problem.
The second thing that I ran into was this error, which appeared when I pressed the button that was supposed to launch my ArActivity (as in this tutorial: https://www.youtube.com/watch?v=MFbEvkWJOV0 ).
The error is this:

java.lang.NullPointerException
at system.CameraView.surfaceCreated(CameraView.java:49)
at android.view.SurfaceView.updateWindow(SurfaceView.java:1126)
at android.view.SurfaceView.access$000(SurfaceView.java:88)
at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:186)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:590)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1642)
at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2467)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)

OS Version: 3.0.8 (20121016) OS API Level: 15 Device: ALLVIEW Model (and Product): AllviewSpeedSatellite (ALLVIEW) Manufacturer: ALLVIEW Other TAGS: test-keys screenWidth: 800 screenHeigth: 432 Keyboard available: false Trackball available: false SD Card state: mounted

[More automatically received system infos]:

java.vm.version = 1.6.0
android.icu.library.version = 4.6
java.vendor.url = http://www.android.com/
java.vm.vendor.url = http://www.android.com/
user.dir = /
java.vm.name = Dalvik
java.home = /system
user.region = RO
android.zlib.version = 1.2.5
user.home =
java.runtime.name = Android Runtime
java.io.tmpdir = /sdcard
http.agent = Dalvik/1.6.0 (Linux; U; Android 4.0.4; AllviewSpeedSatellite Build/IMM76D)
java.version = 0
java.boot.class.path = /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/filterfw.jar
java.library.path = /vendor/lib:/system/lib
file.separator = /
java.specification.vendor = The Android Project
file.encoding = UTF-8
line.separator =

java.vm.specification.version = 0.9
java.vm.specification.vendor = The Android Project
android.openssl.version = OpenSSL 1.0.0e 6 Sep 2011
os.name = Linux
java.vm.vendor = The Android Project
path.separator = :
java.ext.dirs =
java.class.path = .
os.version = 3.0.8
java.specification.name = Dalvik Core Library
java.compiler =
os.arch = armv7l
user.name =
user.language = ro
android.icu.unicode.version = 6.0
java.runtime.version = 0.9
java.class.version = 50.0
java.vendor = The Android Project
java.vm.specification.name = Dalvik Virtual Machine Specification
java.specification.version = 0.9

I receive the same error on my tablet, as well as on Samsung Galaxy SII Plus (GT-I9105P).
What should/can I do?
Thank you for the previous help, too.

@Ionea
Copy link
Author

Ionea commented Aug 18, 2014

And this is the error that I'm receiving on my phone (Samsung Galaxy SII Plus (GT-I9105P).):

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.travelar/system.ArActivity}: android.view.InflateException: Binary XML file line #35: Error inflating class android.support.v7.internal.widget.ActionBarView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2110)
at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2135)
at android.app.ActivityThread.access$700(ActivityThread.java:140)
at android.app.ActivityThread $H.handleMessage(ActivityThread.java:1237)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:805)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #35: Error inflating class android.support.v7.internal.widget.ActionBarView
at android.view.LayoutInflater.createView (LayoutInflater.java:619)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:693)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:752)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:760)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:760)
at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at android.view.View.inflate(View.java:16504)
at system.Setup._e1_addElementsToOverlay(Setup.java:620)
at system.Setup.run(Setup.java:286)
at system.ArActivity.runSetup(ArActivity.java:61)
at system.ArActivity.onCreate (ArActivity.java:38)
at android.app.Activity.performCreate(Activity.java:5206)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
... 11 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView (LayoutInflater.java:593)
... 26 more
Caused by: android.view.InflateException: Binary XML file line #22: Error inflating class
at android.view.LayoutInflater.createView(LayoutInflater.java:619)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:666)
at android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:691)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:752)
at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.support.v7.internal.widget.ActionBarView.(ActionBarView.java:218)
... 29 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView (LayoutInflater.java:593)
... 36 more
Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x2/d=0x7f010013 a=-1}
at android.content.res.Resources.loadDrawable(Resources.java:2239)
at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
at android.widget.ImageView. (ImageView.java:126)
at android.widget.ImageView.(ImageView.java:116)
... 39 more

OS Version: 3.0.31-1040387 (I9105PXXAMD1) OS API Level: 16 Device: s2vep Model (and Product): GT-I9105P (s2vepxx) Manufacturer: samsung Other TAGS: release-keys screenWidth: 480 screenHeigth: 800 Keyboard available: false Trackball available: false SD Card state: mounted

[More automatically received system infos]:

java.vm.version = 1.6.0
android.icu.library.version = 4.8.1.1
java.vendor.url = http://www.android.com/
java.vm.vendor.url = http://www.android.com/
user.dir = /
java.vm.name = Dalvik
java.home = /system
user.region = RO
android.zlib.version = 1.2.6
user.home =
java.runtime.name = Android Runtime
java.io.tmpdir = /data/data/de.rwth/cache
http.agent = Dalvik/1.6.0 (Linux; U; Android 4.1.2; GT-I9105P Build/JZO54K)
java.version = 0
java.boot.class.path = /system/framework/core.jar:/system/framework/core- junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framewor k/framework2.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache- xml.jar:/system/framework/sec_edm.jar:/system/framework/seccamera.jar
java.library.path = /vendor/lib:/system/lib
file.separator = /
java.specification.vendor = The Android Project
file.encoding = UTF-8
line.separator =

java.vm.specification.version = 0.9
java.vm.specification.vendor = The Android Project
android.openssl.version = OpenSSL 1.0.1c 10 May 2012
os.name = Linux
java.vm.vendor = The Android Project
path.separator = :
java.ext.dirs =
java.class.path = .
os.version = 3.0.31-1040387
java.specification.name = Dalvik Core Library
java.compiler =
os.arch = armv7l
user.name =
user.language = ro
android.icu.unicode.version = 6.0
java.runtime.version = 0.9
java.class.version = 50.0
java.vendor = The Android Project
java.vm.specification.name = Dalvik Virtual Machine Specification
java.specification.version = 0.9

My MainActivity.java is:

package com.example.travelar;
import gl.GL1Renderer;
import gl.GLFactory;
import system.ArActivity;
import system.DefaultARSetup;
import util.Vec;
import worldData.World;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.Button;

//@SuppressLint("ClickableViewAccessibility")
public class MainActivity extends ActionBarActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Button b = new Button(this);
    b.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            // TODO Auto-generated method stub

            ArActivity.startWithSetup(MainActivity.this, new DefaultARSetup() {

                @Override
                public void addObjectsTo(GL1Renderer renderer, World world,
                        GLFactory objectFactory) {
                    // TODO Auto-generated method stub
                    world.add(objectFactory.newSolarSystem(new Vec(10,0,0)));
                }
            });
            return false;
        }
    });
    setContentView(b);
}

}

And the AndroidManifest.xml is:

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="21" />

<application android:allowBackup="true" android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" android:theme="@style/AppTheme">
    <activity android:name=".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="system.ArActivity"
        android:configChanges="keyboardHidden|orientation" android:label="@string/app_name"
        android:screenOrientation="landscape" />


    <!-- Custom List is used to easily display lists of any type of object -->
    <activity android:name="gui.CustomListActivity" />


    <!-- the error handler will be automatically displayed when an error appears -->
    <activity android:name="system.ErrorHandler" android:process=":myexeptionprocess"
        android:taskAffinity="system.ErrorHandler">
        <intent-filter>
            <category android:name="android.intent.category.DEFAULT" />

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

            <data android:mimeType="errors/myUnhandleCatcher" />
        </intent-filter>
    </activity>

    <!-- is needed to display information on application startup -->
    <activity android:name="gui.InfoScreen" android:theme="@android:style/Theme.Dialog" />


    <!-- an activity to easily display any kind of ui -->
    <activity android:name="gui.simpleUI.SimpleUIv1"
        android:theme="@android:style/Theme.Translucent" />

</application>

<!-- The minimum sdk version is set to 3 because all the methods should 
    work for devices with android 1.5 as well. The development version is set 
    to 1.6 to get access to stuff like high res. screens (eg samsung galaxy tab) -->


<!-- IMPORTANT: The following permissions should also be added to each project 
    which uses the DroidAR Library -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-feature android:glEsVersion="0x00020000" />

<!-- This should be added to to allow the fullscreen mode to big screen 
    devices like the samsung galaxy tab -->
<supports-screens android:anyDensity="true"
    android:largeScreens="true" android:normalScreens="true"
    android:smallScreens="true" />

Thank you, once again, for your help.

@simon-heinen
Copy link
Owner

java.lang.NullPointerException
at system.CameraView.surfaceCreated(CameraView.java:49)

this means that the device you are executing on has no camera

On Mon, Aug 18, 2014 at 10:49 PM, Ionea [email protected] wrote:

Hi, Simon.
Sorry for the big delay, but I finally managed to get back to work and
solved the previous problem.
The second thing that I ran into was this error, which appeared when I
pressed the button that was supposed to launch my ArActivity (as in this
tutorial: https://www.youtube.com/watch?v=MFbEvkWJOV0 ).
The error is this:

java.lang.NullPointerException
at system.CameraView.surfaceCreated(CameraView.java:49)
at android.view.SurfaceView.updateWindow(SurfaceView.java:1126)
at android.view.SurfaceView.access$000(SurfaceView.java:88)
at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:186)
at
android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:590)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1642)
at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2467)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)

OS Version: 3.0.8 (20121016)
OS API Level: 15
Device: ALLVIEW
Model (and Product): AllviewSpeedSatellite (ALLVIEW)
Manufacturer: ALLVIEW
Other TAGS: test-keys
screenWidth: 800
screenHeigth: 432
Keyboard available: false
Trackball available: false
SD Card state: mounted

[More automatically received system infos]:

java.vm.version = 1.6.0
android.icu.library.version = 4.6
java.vendor.url = http://www.android.com/
java.vm.vendor.url = http://www.android.com/
user.dir = /
java.vm.name = Dalvik
java.home = /system
user.region = RO
android.zlib.version = 1.2.5
user.home =
java.runtime.name = Android Runtime
java.io.tmpdir = /sdcard
http.agent = Dalvik/1.6.0 (Linux; U; Android 4.0.4; AllviewSpeedSatellite
Build/IMM76D)
java.version = 0
java.boot.class.path =
/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/filterfw.jar
java.library.path = /vendor/lib:/system/lib
file.separator = /
java.specification.vendor = The Android Project
file.encoding = UTF-8
line.separator =

java.vm.specification.version = 0.9
java.vm.specification.vendor = The Android Project
android.openssl.version = OpenSSL 1.0.0e 6 Sep 2011
os.name = Linux
java.vm.vendor = The Android Project
path.separator = :
java.ext.dirs =
java.class.path = .
os.version = 3.0.8
java.specification.name = Dalvik Core Library
java.compiler =
os.arch = armv7l
user.name =
user.language = ro
android.icu.unicode.version = 6.0
java.runtime.version = 0.9
java.class.version = 50.0
java.vendor = The Android Project
java.vm.specification.name = Dalvik Virtual Machine Specification
java.specification.version = 0.9

I receive the same error on my tablet, as well as on Samsung Galaxy SII
Plus (GT-I9105P).
What should/can I do?
Thank you for the previous help, too.


Reply to this email directly or view it on GitHub
https://github.com/bitstars/droidar/issues/29#issuecomment-52552937.

@simon-heinen
Copy link
Owner

Caused by: android.content.res.Resources$NotFoundException: Resource is not
a Drawable (color or path): TypedValue{t=0x2/d=0x7f010013 a=-1}
at android.content.res.Resources.loadDrawable(Resources.java:2239)

i think this is the root problem for your exception

On Mon, Aug 18, 2014 at 11:25 PM, Ionea [email protected] wrote:

And this is the error that I'm receiving on my phone (Samsung Galaxy SII
Plus (GT-I9105P).):

java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.example.travelar/system.ArActivity}:
android.view.InflateException: Binary XML file line #35: Error inflating
class android.support.v7.internal.widget.ActionBarView
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2110)
at android.app.ActivityThread.handleLaunchActivity
(ActivityThread.java:2135)
at android.app.ActivityThread.access$700(ActivityThread.java:140)
at android.app.ActivityThread $H.handleMessage(ActivityThread.java:1237)

at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)

at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:805)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #35: Error
inflating class android.support.v7.internal.widget.ActionBarView
at android.view.LayoutInflater.createView (LayoutInflater.java:619)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:693)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:752)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:760)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:760)
at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at android.view.View.inflate(View.java:16504)
at system.Setup._e1_addElementsToOverlay(Setup.java:620)
at system.Setup.run(Setup.java:286)
at system.ArActivity.runSetup(ArActivity.java:61)
at system.ArActivity.onCreate (ArActivity.java:38)
at android.app.Activity.performCreate(Activity.java:5206)
at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
... 11 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView (LayoutInflater.java:593)
... 26 more
Caused by: android.view.InflateException: Binary XML file line #22
https://github.com/bitstars/droidar/issues/22: Error inflating class
at android.view.LayoutInflater.createView(LayoutInflater.java:619)
at
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:666)
at android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:691)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:752)
at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at
android.support.v7.internal.widget.ActionBarView.(ActionBarView.java:218)
... 29 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView (LayoutInflater.java:593)
... 36 more
Caused by: android.content.res.Resources$NotFoundException: Resource is
not a Drawable (color or path): TypedValue{t=0x2/d=0x7f010013 a=-1}
at android.content.res.Resources.loadDrawable(Resources.java:2239)
at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
at android.widget.ImageView. (ImageView.java:126)
at android.widget.ImageView.(ImageView.java:116)
... 39 more

OS Version: 3.0.31-1040387 (I9105PXXAMD1)
OS API Level: 16
Device: s2vep
Model (and Product): GT-I9105P (s2vepxx)
Manufacturer: samsung
Other TAGS: release-keys
screenWidth: 480
screenHeigth: 800

Keyboard available: false
Trackball available: false
SD Card state: mounted

[More automatically received system infos]:

java.vm.version = 1.6.0
android.icu.library.version = 4.8.1.1

java.vendor.url = http://www.android.com/
java.vm.vendor.url = http://www.android.com/
user.dir = /
java.vm.name = Dalvik
java.home = /system
user.region = RO
android.zlib.version = 1.2.6

user.home =
java.runtime.name = Android Runtime
java.io.tmpdir = /data/data/de.rwth/cache
http.agent = Dalvik/1.6.0 (Linux; U; Android 4.1.2; GT-I9105P Build/JZO54K)
java.version = 0
java.boot.class.path = /system/framework/core.jar:/system/framework/core-
junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framewor
k/framework2.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-
xml.jar:/system/framework/sec_edm.jar:/system/framework/seccamera.jar

java.library.path = /vendor/lib:/system/lib
file.separator = /
java.specification.vendor = The Android Project
file.encoding = UTF-8
line.separator =

java.vm.specification.version = 0.9
java.vm.specification.vendor = The Android Project
android.openssl.version = OpenSSL 1.0.1c 10 May 2012

os.name = Linux
java.vm.vendor = The Android Project
path.separator = :
java.ext.dirs =
java.class.path = .
os.version = 3.0.31-1040387

java.specification.name = Dalvik Core Library
java.compiler =
os.arch = armv7l
user.name =
user.language = ro
android.icu.unicode.version = 6.0
java.runtime.version = 0.9
java.class.version = 50.0
java.vendor = The Android Project
java.vm.specification.name = Dalvik Virtual Machine Specification
java.specification.version = 0.9

My MainActivity.java is:

package com.example.travelar;
import gl.GL1Renderer;
import gl.GLFactory;
import system.ArActivity;
import system.DefaultARSetup;
import util.Vec;
import worldData.World;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.Button;

//@SuppressLint("ClickableViewAccessibility")
public class MainActivity extends ActionBarActivity {

@OverRide
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

Button b = new Button(this);
b.setOnTouchListener(new OnTouchListener() {

    @Override
    public boolean onTouch(View v, MotionEvent event) {
        // TODO Auto-generated method stub

        ArActivity.startWithSetup(MainActivity.this, new DefaultARSetup() {

            @Override
            public void addObjectsTo(GL1Renderer renderer, World world,
                    GLFactory objectFactory) {
                // TODO Auto-generated method stub
                world.add(objectFactory.newSolarSystem(new Vec(10,0,0)));
            }
        });
        return false;
    }
});
setContentView(b);

}

}

And the AndroidManifest.xml is:

package="com.example.travelar" android:versionCode="1"
android:versionName="1.0">




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

<activity android:name="system.ArActivity"
    android:configChanges="keyboardHidden|orientation" android:label="@string/app_name"
    android:screenOrientation="landscape" />


<!-- Custom List is used to easily display lists of any type of object -->
<activity android:name="gui.CustomListActivity" />


<!-- the error handler will be automatically displayed when an error appears -->
<activity android:name="system.ErrorHandler" android:process=":myexeptionprocess"
    android:taskAffinity="system.ErrorHandler">
    <intent-filter>
        <category android:name="android.intent.category.DEFAULT" />

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

        <data android:mimeType="errors/myUnhandleCatcher" />
    </intent-filter>
</activity>

<!-- is needed to display information on application startup -->
<activity android:name="gui.InfoScreen" android:theme="@android:style/Theme.Dialog" />


<!-- an activity to easily display any kind of ui -->
<activity android:name="gui.simpleUI.SimpleUIv1"
    android:theme="@android:style/Theme.Translucent" />

Thank you, once again, for your help.


Reply to this email directly or view it on GitHub
https://github.com/bitstars/droidar/issues/29#issuecomment-52557597.

@Ionea
Copy link
Author

Ionea commented Aug 21, 2014

Indeed, this was the problem. I searched a little bit on google and eventually managed to find the cause of my problem.

Resource is not a Drawable (color or path).

Now I have another issue. I want to use the ModelLoaderAdapters so I can display a .obj file that I've created with Google Sketchup, but I can't manage to find all the files on the LibGDX repository, and that's because they've switched to Gradle. I've tried downloading gdx and gdx-extension, searched on google for model-loaders (because they didn't have it anymore on the repository) and eventually managed to complete my missing projects, but unfortunately, I get some errors because the gdx-backend-android are missing some java files (such as: AndroidGL10.java, AndroidGL11.java, AndroidGLU and others), and I can't seem to find a proper solution for doing this.

Later edit:
I found the solution to this problem:

Also, another thing that I didn't manage to make it work is the GeoPosTestSetup from DroidAR. I >tried two things:

  1. Make an app and use DroidAR as a library and place a cube at GPS coordinates.
  2. Change the coordinates in the DroidAR app and try to see if it displays me the cube at the >specified coordinates.

In both cases, at the specified GPS coordinates it displayed me the xyz coordinates (which worked >well), but didn't load any cube.

But the ModelLoaderAdapters is still not working.
Or is there any way of placing an *.obj file at GPS coordinates?
Any suggestions are highly appreciated. Thank you!

@Ionea
Copy link
Author

Ionea commented Sep 8, 2014

Hi, once again.
I'm back with more update and struggles, unfortunately.
Since my last post, I managed to make the ModelLoaderAdapters to work (it was a real pain in the ass). But now, I managed to load my 3D object (obj type) on the screen and looks great. My problem is that I cannot import the model into my own project.
I tried following your tutorial regarding this problem, but I cannot make it work.
The first thing that I didn't manage to go through was importing the GDXmesh into my project. I was only able to see the mesh in ModelLoaderAdapters.
The second thing that's bugging me is that I cannot see (in ModelLoaderAdapters) the obj file at GPS coordinates. I tried changing in MLA this line: final Obj o = new Obj(); with this one: final GeoObj o = new GeoObj(42.180744, 27.180597);, but by doing this I was unable to see the obj file. With final Obj, it worked, but the GPS was searching for about 5 minutes and didn't find a location. After pressing the Skip button, the model was loaded on the screen.

I know I'm a little bit annoying, but I do not have any other place to go for help. So, I really need a hand here, cause time until sustaining the project is very, very limited.
Thank you.

Later edit:
I tried the modified ModelLoaderAdapters on a Samsung Galaxy S3, with the final GeoObj o = new GeoObj(42.180744, 27.180597) instead of final Obj o = new Obj(); and managed to get this:
10663102_932691453413924_622314735_o

A couple of things that I cannot explain:

  1. Why isn't it updating my GPS coordinates? (it seems to keep a relative position with the xyz coordinates, but doesn't apply to GPS, as if the GPS isn't receiving any signal).
  2. Why is it flipped? (When I first loaded the modelloader, it displayed that gate from a perspective view, so I was able to see only one pole but it was standing on his "feet").
  3. How was it possible to display that little man (using sketchup, the little man is centered on the xyz coordinates, for scale). I initially loaded the obj model with min3d framework, and there didn't displayed anything like that. In droidar, it shows me the little fellow, even though I used the same obj file for both frameworks. And, from what I know, when exporting with google sketchup, that figure isn't exported.
    Ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants