Open Ionea opened 10 years ago
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 notifications@github.com 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.
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)
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
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 notifications@github.com 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.
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 notifications@github.com 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: <?xml version="1.0" encoding="utf-8"?> package="com.example.travelar" android:versionCode="1" android:versionName="1.0">
<application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme">
``` <activity android:name="system.ArActivity" android:configChanges="keyboardHidden|orientation" android:label="@string/app_name" android:screenOrientation="landscape" />
<activity android:name="system.ErrorHandler" android:process=":myexeptionprocess" android:taskAffinity="system.ErrorHandler">
<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. — Reply to this email directly or view it on GitHub https://github.com/bitstars/droidar/issues/29#issuecomment-52557597.
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:
- Make an app and use DroidAR as a library and place a cube at GPS coordinates.
- 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!
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:
A couple of things that I cannot explain:
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.
The error I get is this:
Multiple markers at this line
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 :)