Eclipse development woes - android

I would like to ask my fellow developers of their experience with eclipse.
I have recently started with eclipse and android, though the interface and development is not bad at all; but i have a major nagging issue.
Out of the blue eclipse or android compiler, am not sure, decides to go bonkers and misbehave. I spend so much time trying to debug and find errors in my code just to realize that a shutdown and restart of eclipse fixes it.
For example, one of my elements was returning null (using findViewById in android) - i spend about an hour trying to debug. Then decided to restart eclipse and it was fine. I wonder why?!
Is there anything that i ought to do ? ANything that i am missing with the eclipse settings. It really troubles me because it puts a brake on my development every now and then
Thanks

I personally never got comfortable with Eclipse and wound up settling on IDEA. When I had to work in C#, I found I was so stuck on it that I sprung out of my own pocket for the plugin to make Visual Studio work like IDEA
When I started to pick up Android, I begrudgingly went back to Eclipse, but once I needed to actually do something in Android, I checked back and discovered current version of IDEA (including the free one) supports Android development now too. Instructions for Eclipse all translate to it reasonably well, and the emulator won't change, so if that's where the issue is, you should find out reasonably quickly.

There are two general things that I suggest:
Fire up the emulator from outside of eclipse at startup time and leave it running (if you don’t already do this).
Add some memory to your development machine.

Related

Xamarin Forms Android This type of collectionView does not support changes to its sourceCollection from a thread different from the dispatcher thread

Here is the error I'm getting when trying to archive my app for deployment.
This error doesn't show up at any other time. The project builds and runs on emulators and devices without issue. This error has zero context or direction as to where to look to fix it. It also just randomly showed up out of nowhere, last time I built/archived (with zero functional changes) this error did not happen.
Main difference between this archival and the previous one is a newer version of VS 2017. Don't remember exactly the version from before, but am currently on 15.9.4 (stable).
Looking around on the interwebs, I've found that this error seems to have something to do with ObservableCollection's, which there are probably 10-ish in my app. Not really sure what to do here, because this has never been an issue previously, and I'm coming up on a deadline and with the structure of the app, am not in a good position to start making functional changes.
EDIT
I have also cleaned and rebuilt my solution, as well as deleting all bin/obj folders in my xamarin projects. Even tried deleting the .vs folder which can sometimes help. But still no go.
Going to try updating VS to 15.9.5 and see if maybe it was fixed in a release.
EDIT 2
Updating VS 2017 to 15.9.5 made no difference.
EDIT 3
I had my coworker try archiving the exact same project on his machine (running VS 2017: 5.9.3, and it archived fine for him. So far that's the only difference we've been able to find between our environments.
I saw the same problem using VS2017 15.9.9. Even the same code that could be archived a week ago threw the above mentioned error. It seems related to local data in the solution. A "clear" build was not sufficient. However manual deletion of the local obj and bin folders followed by archiving (build is done implicitly) solved the problem for me.
For my part closing Visual studio and deleting the .vs hidden folder did it.
It's actually a fix for many issues using Xamarin.
I had this other issue where I couldn't archive because the build process would just hang and never end. Deleting the .vs folder did it too.
https://github.com/xamarin/xamarin-android/issues/1760
Just go to project property then go to Android options-> Select Advanced then increase the Java Max heap size to 2G/3G -> it's working for me.
Leon Lu's suggestion worked. I don't particularly like it, as it took forever and repairing basically restores you to a base install (no extensions or personalizations). Took about 1.2 hours to complete, but once done I was able to again archive my android application. I guess something went wrong in vs at some point, perhaps during an update. There's no way to tell.
I tried ALL of the ideas above, but had no consistent reliable luck with any of them.
I found that Microsoft has had the problem reported to them (see link below). After a ton of time burn on this, I posted at the link below one way that I've been able to get around this archive-build issue.
Like the other fixes, it's not exactly logical, and nothing that you would think would work, but I've found the process to be repeatable, which is golden for me with tight timelines and having no time for this.
MS Visual Studio Developer Community Problem 507708
Posted on a Saturday morning, a sign of really needing to get around this urgently. I hope it helps you too.

Getting an App APK

Hey guys and girls for a the past week I've grown a lot of interest in android studio (even without knowing quite much about it) I decided to create an app that I deemed quite useful. However the app required maps to be integrated in it and I really did not know what I was doing and at one point I started messing with the settings and then all hell broke loose and I kept getting AAPT2 errors and I even tried to fix this issue with the gradle properties line that you add (I forgot the line of code to add). Anyways it still didnt work. However I rembered that I always kept the good version (before I broke everything) of the app on my phone. So when I go in my phone the app is there and it works just fine. Ive tried so many things to get the source code from the app on my phone without any succes. My question is, how can I get the source code back from the working app onto my laptop to continue coding in android studio? If it helps I am using Linux 18.04 LTS and running the newest version of android studio. Thank you for any help from you guys. This means a lot to me.
You can’t get back the ‘source code’ from an already compiled app.
You should consider using some version control platforms like git from the next time

New Android Eclipse version won't get to workspace

I'm trying to start out with Android programming (I'm running Mac OS X Lion). I had an old version of Eclipse and installed ADT version 20 in it, and code didn't compile properly. Fine; I hadn't done much in there, and after reading some stuff here it sounded like the easiest thing for the long run would be to put together a completely new installation.
So I downloaded the latest version of Android, with the SDK, from the Android developer Getting Started site, and ran it (in its own directory). I loaded one of my previous workspaces and it said that one wouldn't work because the ADT was version 20 and it needs 21. I figured fine, there wasn't much in there and I'd just start a new workspace.
So I started a new workspace, and here's where the real trouble came: It gives me the start screen with newbie welcome instructions but won't go any further than that. When I try to create a new Android Application Project, it goes through the menus but as soon as I click Finish I get a please-wait circular icon, and little happens. There's a line at the bottom that says "66M of 142M" - it increases slowly into the 80s and then drops back down into the 60s, endlessly. And the links provided on the welcome page (Building Your First App, etc.) don't work - I click on them and nothing happens.
Any idea what's going wrong here? Is there some cruft left over in my system from older versions, which I should delete? If so, how should I go about doing that? If not, what else might I try to get it working?
I can't comment beneath yours because of my level, but you can help Eclipse run faster by giving it more memory. Doing this speeds things up quite a bit.
As far as installations go, maybe try Google's packaged version of Eclipse + Android SDK. The whole package is available here. It's already preconfigured to work and provides eclipse with ADT installed by default. Of course, if you already have an existing Eclipse you want to modify this won't help you too much. But if you're new to Eclipse it's a good way to get started with Android development.

Benefits of switching from Eclipse to IntelliJ IDEA for Android development [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have been using Eclipse for Android development and don't have a problem with it (I also use it for Web Service and C++ development under Linux) but I want to give IntelliJ IDEA a go as it appears to have favourable reviews. This is easily possibly now that IDEA 10 has been released with Android support enabled in the Community Edition.
I have looked at IDEA and it looks pretty good to me with the only downside being the lack of UI on .xml file editing (AndroidManifest.xml for example) and the user interface builder provided with ADT 9.0.
Has anyone got experience they can share on IntelliJ IDEA and Android development?
EDIT: Thanks all; I'm sticking with Eclipse as I know it pretty well and it allows me to do pretty much anything (Java-related) I like for free. I shouldn't look a gift horse in the mouth!
The only benefit for me: You code as fast as formula 1 :). Really. If you're used to Resharper in .NET programming, then you will code as fast as in .NET. Even faster.
Bad thing: lack of some Eclipse's tools (browse my questions for details) and it seems that Eclipse's compiler--which you can use from IntelliJ as well--is better. Because of the lack of some tools you are forced to use many 3rd party tools.
The bottom line is: if you don't have problems with Eclipse, then stick to it. I hated Eclipse's slowness and that's why I moved to IntelliJ.
EDIT 23 Jan 2013
IntelliJ has improved a lot. They now have UI visual editor, a great connection to Android SDK and at this moment I can't really think of any feature which Eclipse has and IDEA does not have. What's better, I will say again that IDEA has more features than Eclipse.
EDIT 11 Mar 2014
Again IntelliJ improved. With its visual UI editor for XML layouts and itself being used as the base for Google's Android Studio, its still the best IDE around.
The only flaws for Android developer are IMHO:
it still does not perfectly import dependencies (libraries) so you have to fix things manually
it does not perfectly recognizes other projects (modules) which sometimes you have to add those modules manually
a support for Google Glass does not exist
All this is referring to when importing projects made in Eclipse, which happens very often to anyone working on multiple Android projects.
I have used both, they aren't that different. A lot of it is just what you are used to. Personally, if you aren't having any problems with Eclipse, I would not suggest switching. There are no advantages that are worth the learning curve.
I switched to IDEA for my android development.
Intellisense actually works
IDEA is much faster
The refactoring is nicely done, and the "inspections" catch a lot of places where refactoring would make sense
Things I miss:
The new Layout viewer from Android 3.0. I always modify the layout xml, but it's nice to be able to switch over and get an idea of what it will look like without running the app. I do load up eclipse for this reason when I do heavy layout editing.
Hover documentation. In intelliJ, you have to press ctrl+Q to get the javaDoc of an existing method call (vs intellisense popping up as you code).
I know eclipse is free, but come on, I don’t know how people actually use it to build software. I like open source as much as the next guy, I just like “high quality open source” which may be an oxymoron.
I want to get work done and not fight the tool no matter how free it is.
After 2 years of Android Development on Eclipse I finally give up. I hate it because:
1. Eclipse is slow.
2. Search and autocomplete is poor.
3. Require big among of memory.
4. Crashing and hanging constantly.
5. Correct or incorrect way of closing Eclipse may cause workspace and settings crash.
Eclipse: reminding me every time I use why I normally don't use it. -
Romain Guy
You can check some of interesting IntelliJ IDEA features here
Google has introduced new intellij-based IDE for android development (if you dont want to pay for intellij), you can find more info here http://developer.android.com/sdk/installing/studio.html
I am interested in this question too. For me, eclipse starts to be slow as more plugins installed: CDT, aptana, pydev, ADT....
IDEA seems like a light-weighted and interesting alternative. For the lacking of layout xml editing, you may do it with http://www.droiddraw.org/, or its desktop version. Pretty amazingly easy after reading the droiddraw tutorials.
I haven't got enough experience with IDEA, so cannot help a lot. Hope more people cast light on this issue.
Thanks,
Frank
I think Eclipse has all the features that an IDE should have these days.
But from my point of view it does everything on the wrong way (I am a Visual Studio fan).
After I tried IDEA, I had to realize that it can be customized to act nearly the same as VS, so it IS a very good IDE.
And the version 12 has UI editor for Android.
I can say that try to compare their IntelliSense (or whatever you call it), the debugger (including watches) and the editor. Much more better, smarter, faster for a daily use.
IDEA ultimate is not free, but if you would like to make money with programming I think you can make it easier with professional tools.
I would never pay for Eclipse.
As a new IDEA user I found the IDE to be somewhat overwhelming at first. The IDE contains more options than I thought possible and can bring into question - "Just how many checkboxes can you fit on a screen". Once the shock passed and I was able to complete a small project, I'm in love. Sorry Eclipse, but you were kind of flakey and would have unpredictable behavior. IDEA is rock solid.
As a programmer I want rock solid tools and sometimes the phrase "you get what you pay for" is valid.
Google's Android Studio is built on top of IDEA, assuming that it will be the "Official" developer tool when it reaches 1.0, it might be worth getting up to speed by learning IDEA.
It also has a "dark" theme built in so you don't have to mess around with Eclipse plugins.
Quick comparison
between eclipse 4.3.2 and intellij 13.0.2:
I will refer to intellij idea as I as an abbreviation below (e.g. I12 means intellij idea version 12)
Both are fine .
Pro Intellij are:
Faster compiler mode:(introduced in I12) exactly as with eclipse, now Intellij compiles everything continuously in the background and shows you files that doesn't compile with red zigzag. Exactly as Eclipse but less heavier and more responsive .
Android UI editor: (introduced in I11) even better than the one in eclipse ADT plugin: it shows more properties as android:layout_span ,i.e. Advanced properties that are hidden in Eclipse UI editor forcing you to edit them from Layout XML , can be easily editted from Intellij UI editor. Also while Eclipse UI editor hangs when selecting multiple components then editting one common property , this is extremely fast and easy in Intellij UI editor. It also can show you a preview while editing XML code, which you can't do in eclipse.
Best content assist : it auto completes when you enter next limiter (space or semicolon or brackets or dot ) you don't have to press enter then press the next limiter, exactly as Visual Studio Intellisense. Also Intellij puts most relevant result on top. another feature introduced in I12 is that it searches if matches are available from the middle not from start.
Fast: intellij is much faster than Eclipse. Eclipse 3.8 is slow and Eclipse 4.2 is even slower due some bugs, that were fixed gradually in Eclipse 4.2.1 and 4.2.2 releases .
more stable than eclipse. In Eclipse, A row of Layout properties editor may stick on screen while you scroll, a very bad UI glitch. Also Eclipse x64 crashes very frequently as compared with eclipse x86 or Intellij, may be because of bugs in JDK x64.
Add framework support:( New in I13) a wizard to add framework support
As of intellij 13, it has wizard like (New->Android-> Android Activity) as that in eclipse adt plugin , maybe the only difference is the intellij wizard may force you to a higher minimum SDK version, while eclipse doesn't .
Con Intellij:
Gradle: Android project wizard: (New in I13) when you create an app you can define in a gui wizerd : min sdk , target sdk , icons and theme (all these fills in the gap between eclipse and previous Is) and support mode ( an advantage over eclipse). Although this might be considered an advantage, gradle added so many errors to managing an android project, that intellij became not usable as before in intellij 12. most errors require either changing configuration and updating a maven repo from internet , or navigating to a folder and running a command from terminal.
Doesn't support NDK (Native Development Kit for development in C/C++)
I have been using IDEA for professional Android development for almost a year, it is much better than Eclipse because:
The IDE is much faster and stable
Excellent interface designer
Other good enhancements such color picker in XML, creating resource directories and creating String resources.
IDEA is much better for Android development and you will increase your productivity for sure, Google knows this, that is why Android Studio is built on top of IDEA

Android Apps Not Showing Up In AVD

I recently started messing with Android Apps, but I have had nothing but problems trying to get them into the Virtual Device for testing. For some reason, they never seem to show up in the AVD. It has worked one time, but that's it out of hours spent just trying to test one or two very simple apps.
I've redone the AVD setup many, many times, trying different settings and what not to no avail. I've followed multiple guides and tutorials to the letter to get it working, but they just refuse to show up in the list. :(
Any insight would be appreciated, thank you.
I would start by testing apps that are known to work. Here are sixty or so of them.
In particular, I would start with this one. Do not change anything. Do not import it into Eclipse. Just install Apache Ant (if you haven't already), and run ant install in the project directory with your emulator running.
Either this shows up in your emulator, or it does not.
If it does not, try reinstalling the entire SDK.
If it does, then you know that your base environment is OK, and you can start slowly determining the differences to figure out where things are going wrong.
Helping you is difficult right now because your symptoms are a bit generic. It could be that you are using Eclipse and Eclipse is having a problem. It could be that your adb daemon is having a problem. It could be that you don't have any activities in your manifest, so the application is actually installing but there are no icons in the launcher. And so on.

Categories

Resources