Closed wennycooper closed 7 years ago
referring to this ... https://github.com/rosjava/android_apps/issues/42 (second last point)
change the above code to this ..
mapView.onCreate(Lists.
should do the trick .. and without altering the old android library
Thank you!!
Change this code:
mapView.addLayer(viewControlLayer);
mapView.addLayer(occupancyGridLayer);
mapView.addLayer(laserScanLayer);
mapView.addLayer(pathLayer);
mapView.addLayer(mapPosePublisherLayer);
mapView.addLayer(initialPoseSubscriberLayer);
To:
mapView.onCreate(Lists.
I tried this method. However, I get an error saying: Process: com.github.rosjava.android_apps.make_a_map.indigo, PID: 1031 java.lang.RuntimeException: An error occurred while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:309) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354) at java.util.concurrent.FutureTask.setException(FutureTask.java:223) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.IllegalStateException: setRenderer has already been called for this instance. at android.opengl.GLSurfaceView.checkRenderThreadState(GLSurfaceView.java:1935) at android.opengl.GLSurfaceView.setEGLConfigChooser(GLSurfaceView.java:470) at android.opengl.GLSurfaceView.setEGLConfigChooser(GLSurfaceView.java:539) at org.ros.android.view.visualization.VisualizationView.onCreate(VisualizationView.java:81) at com.github.rosjava.android_apps.make_a_map.MainActivity.init(MainActivity.java:308) at org.ros.android.RosActivity$2.doInBackground(RosActivity.java:204) at org.ros.android.RosActivity$2.doInBackground(RosActivity.java:201) at android.os.AsyncTask$2.call(AsyncTask.java:295) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818)
The "MainActivity" part indicates the mapview.onCreate method.. I really don't get why I am getting this error
@HelloEgg this report is for map_nav, not make_a_map, would you mind opening a separate issue for this?
Oh I WAS having problem with "map_nav" Do you have any known repository that works on Android studio 2.2.2? gradle version I use is 2.2.1
@HelloEgg the stack trace shown above is for make_a_map.
If you test the latest kinetic versions of android_core and android_extras, they are working on Android Studio 2.2.2.
I was able to go through most of the basic / core applications, but not android_apps unfortunately.
Oh.. I must have uploaded wrong stack trace.. kinetic version of android_core works perfectly fine, however I want to use "map_nav" and other apps that are included in "android_apps"
@HelloEgg unfortunately no one seems to have had the time to update android_apps yet. If you could please send a PR with the changes you're doing and post the correct stack trace perhaps together we can find the issue and incorporate the workaround for you and everyone else.
Could you tell me what you mean by "PR"? Changes I made on "MainActivity" was exactly the same code with what stonier fixed(https://github.com/rosjava/android_apps/commit/9e780b4bbb647360a3ebfb25b0edbb9b8e023391) And stack trace were: Process: com.github.rosjava.android_apps.map_nav.indigo, PID: 25063 java.lang.NullPointerException: Attempt to invoke virtual method 'void android.opengl.GLSurfaceView$GLThread.surfaceCreated()' on a null object reference at android.opengl.GLSurfaceView.surfaceCreated(GLSurfaceView.java:629) at android.view.SurfaceView.updateWindow(SurfaceView.java:712) at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:209) at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:1014) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2560) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1487) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7450) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:920) at android.view.Choreographer.doCallbacks(Choreographer.java:695) at android.view.Choreographer.doFrame(Choreographer.java:631) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:906) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:158) at android.app.ActivityThread.main(ActivityThread.java:7229) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
@HelloEgg I don't know if this is an option for you but these apps are available from the Google Play Store. If you install them from there they do work fine.
Resolved! I commented on #55 Apparently neither addlayer or #42 seems to be current solution. Therefore, do depend on local android_10 or android_15 rather than whats in github
Indeed the solution is to use android_15 v0.3+. For example use the following line:
compile 'org.ros.android_core:android_15:[0.3,0.4)'
Will submit a PR fixing this.
Any luck building this? I'm still having missing resources issues:
Using Android 2.2.2 and gradle version 2.2.1 (also tried 2.14.1)
git checkout -b kinetic https://github.com/rosjava/android_apps.git
SDK 15 target
example errors that appear: Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
When experiencing this type of issue, it's normally resolved with something like:
compile 'com.android.support:appcompat-v7:<platform version>'
I'm guessing that
compile 'org.ros.android_core:android_15:[0.3,0.4)
replaces this?
@JENkt4k yes, compile 'org.ros.android_core:android_15:[0.3,0.4)
should solve the issue. Which particular project is failing to build? Could you please upload a gist with the full log?
I'm getting the same error too... I think the Gradle scripts need some updating, I will issue a PR with the fixes soon
@jubeira You are the man! It built and ran after update. I'm currently looking through your changes, and I see some similar to the ones I made locally, but I haven't found the piece(s) I was missing, or maybe never I tried the entire/exact combination, BeyondCompare to the rescue soon I suppose. Thanks again for your help.
@adamantivm Sorry I did't get back to you in time, been working on some other issues related to Kunman SM5-1 Android/ROS/Python integration. Hopefully I'll be able to share with you soon. Thanks for the support.
@JENkt4k YW! That's what the community is for ;). Perhaps you didn't apply the kinetic script with the latest Gradle version in the top-level script. I think this is the best way to get your project working with the current tools. I can't tell if all the apps work as expected though. If you see something broken, please feel free to open an issue/ send a PR.
I got following errors in building map_nav module in Android Studio.
I post the same problem in ros answer as well. Plz help!! Thanks!!
http://answers.ros.org/question/220324/building-android_apps-errors-on-android-studio/