Related to the question here, is the Android Library Update step necessary and, if not, can it be removed from the startup and/or build process? A manual update seems like an appropriate option, especially if it improves build times and you already have a previous clean compile.
You can disable Android Development Toolkit from General -> Startup and Shutdown.
this may not exactly answer your question, but if you do have a lot of projects it will rebuilt all of it when you open eclipse. what i do myself is i "close" the projects that I'm not working on and I find it more tolerable
If you don't need to debug your native code, you could simply not add native support in the first place and just build it on the command line when needed. Then your eclipse project would simply act as a Java only project and build quickly.
I had this problem with 50 ish projects in my workspace. Not all of them are open at once. Still the 'Android Library Update' would show up every time I needed to update a small thing on every project and really slow me down.
I tried following but the last one worked like a charm for me.
Obviously, opening only related projects helps too.
Removing Build Automatically gets rid of this problem but makes twice more problems. You end up wasting more time manually building the projects. Didn't work for me at all.
Selectively building only the projects that changed helps too.
But the main thing that completely fixed this problem for me was following
Go to Window->Preference->Android->Build and make sure the third check box Skip packaging and dexing until export or launch. is marked on.
Related
I would like to contact you with the problem that I switched from Delphi version 10.4 to Alexandria (11.2).
From then on, my Android applications compile and build without error, but after the splash screen they do not start on Android devices, regardless of the Android version. Not even on those that ran without errors before.
I did not change the source code, only the development tool was updated.
Looking around the Internet, others are also complaining about this phenomenon, but I can't find a solution anywhere.
My respectful request would be that if you can suggest some kind of solution, please let me know, because this is why I am standing still and it would be good to move forward.
Thank you in advance for your answers.
Android system libraries have been reset to default.
There are a lot of possibilities. Here are a few steps you can use to troubleshoot this sort of failure.
Always back up your project first. Preferably using source control!
Revert Deployment
In the release notes for 11 Alexandria there is section about updates to the Android Manifest
An older Android Project Might Fail at Run Time or When Debugging
Building an older Android project in the IDE can cause the app to fail
at run time and debug time, with a Java "Class not found error". To
correct the issue, do the following:
Select Project > Deployment.
In the Deployment Manager, click the Revert To Default speed button.
It is the 7th button that looks kind of like "undo". Make sure you select the Android platform.
Test a New Project
Create a new simple project from scratch and see if it will run. Try both Android 32-bit and 64-bit. If it doesn't then there may be something wrong in your SDK Manager (Tools -> Options -> Deployment -> SDK Manager).
Look under Android on all three tabs: SDK, NDK, Java; for any warning symbols. You might need to correct a path or install Android support.
Compare AndroidManifest.template.xml
Take the AndroidManifest.template.xml from the new project you created, and compare it to the one in your project from a previous version. If you haven't modified it then you can just copy the new one over the old one.
Revert Android Libraries
Expand out the Project Manager and the Android platforms to Libraries. Right click and choose Revert System Files to Default.
More Debugging
You can use ADB LOGCAT to see the error on failure. This is super useful. There are GUI wrappers for it, like DeviceLens by Dave Nottage of DelphiWorlds.
Check the code in your form constructor. An exception here can cause a crash like you are describing.
Reboot your phone. I hate how often this fixes things for me. It should be the first thing, but it is usually the last.
I have an Android Studio (Bumblebee 2021.1.1) project, composed of a main app plus two imported libraries, one Java and one native, developed by me.
At a certain point in time - I cannot recall any event related to this, - the compiler has stopped recognizing the code changes.
If I write something random (e.g. my name, or "aaaaa") within a code that has thus far compiled successfully , the IDE marks this in red as error, however, when I press Ctrl+F9 ("Make Project"), the compiler does not detect any change in code and ends with "BUILD SUCCESSFUL". This happens also when I explicitly save the modified code. The only way I have to make the compiler detect the change is to launch "Rebuild Project". I have tried all the solutions proposed in Android communities (delete ".idea" and ".gradle" folders, invalidate cache, etc.), to no avail. To be noted that I have other projects on the same PC with the same Android Studio instance, but the always-successful-build only happens with the project mentioned above. Can anybody please help me? This is very frustrating, because, even for a tiny code modification, I have to rebuild all, which is very time consuming. Thank you very much.
When I make some changes in source code, Android Studio (actually gradle) needs to rebuild the project. It's obvious.
Why the second build takes almost the same amount of time like the first build, even if I haven't made any changes in the project?
When I look into GradleConsole it waits on "assembleDubug" task. I think gradle should be aware there're no changes and shouldn't waste so much time on it.
Finally, I found the solution: turn on Offline work for gradle.
or using CLI:
./gradlew --offline assembleDebugOrWhatever
Does the gradle console say
:app:assemeble UP-TO-DATE ?
If you take a look at the run configuration, you might notice at the very bottom Before Launch: Gradle-aware Make
This is just telling it to recompile(if necessary) before running, but that detection is delegated to Gradle. Gradle will only actually recompile if it detects that it needs to, but the assemble task must still attempt to run to detect UP-TO-DATEness. So it says it's running it, but its not actually doing anything. When I run it two times in a row, the first time it takes a while to do everything, BUT the second time it just runs through the task list pretty quickly (with a bunch of UP-TO-DATEs) and deploys to phone/emulator.
To avoid rebuild EACH TIME, i'm going to my module project settings -> Dependencies and up or down one of my library item -> Apply -> Ok -> Make regenerating R.java.
You could also try unchecking "Use external build" in compiler settings:
File -> Settings (Ctrl+Alt+S) -> Compiler -> Uncheck "Use external build"
This isn't a problem per se. And it has nothing to do with Android Studio since Gradle is just an Android Plugin that helps you build your projects. You need to fully understand what gradle does to know why Android Studio uses it whenever you run your apps. Take a look at this nice SO question on gradle and the android developer website's article on it. Finally, from my personal experience,when it comes to dealing with Android Studio and Eclipse for Android development, you need to be a little patient. Hope this helps in some way.
My app was working and I did not change a single thing in the source code.
Eclipse updated and now when I try to run the app it doesn't open and that error messages shows up where you have to force close it. It doesn't even have the other option of wait like I have seen before.
I know this is very little information but that is all I have and that is why I am so frustrated. I reverted back ... I reinstalled eclipse and the android plugin. I tested Hello World and that worked fine. I am so lost. This really sucks. Please help.
If you have third-party JARs in your project, then I experienced the same thing this morning. You can verify this (poor choice of words, I know) if your LogCat shows a VerifyError with no helpful information as the cause of the problem.
The solution that worked for me was to check these items in Project Properties > Java Build Path > Order and Export.
If this doesn't help, can you post the LogCat output?
I've run into the same issue whether I have 3rd party JARs or not. As sastraxi says, when this is a result of a 3rd party JAR, fixing the build path often fixes things. I often find the most effective solution, however, is to click Project -> Clean. This realigns all resources and rebuilds the project according to whatever the new SDK's rules.
Hope this helps,
FuzzicalLogic
Just my a new Android phone and I've been tinkering with some basic apps. It's been driving my crazy that the Android plugin for Eclipse refreshes externals folders whenever I save ANYTHING. Normally I wouldn't mind but when it takes 10s to refresh I start to notice.
I already searched and other people have this problem, but there are no solutions.
If it matters, Eclipse 3.5 running on a 64bit jvm on Ubuntu 9.10
If you have references to external sources put them in a zip file:
YourProject->rightClick->Properties->Java Build Path->libraries->..., and then most notably android.jar, but other libs can be the culprit too. Expand it and and select Source attachment, and then (if it doesn't say 'None') press the 'Edit...'-button. If that points to a directory waht you should do is compress that source-directory into a zip file and make the source attachment point to that file.
Apparently eclipse/adt feels the need to refresh sources on the file-system. When they're in a zip-file it seems confident that they have not changed....
You could try disabling "Build automatically" from the Project menu.
First of all Eclipse has a cool feature called a Preferences menu which is located under the window menu located at the top of the screen. Inside there are all sorts settings for pretty much anything you could want to adjust, including the option to turn off Native file system hooks and polling (under General -> Workspace). This is the actual solution to your problem as disabling build automatically doesn't solve the external folders issue, as soon as you build your project it starts right back up with refreshing them. Just keep in mind that if you update your Android SDK at all you will probably need to right click on the root directory of your project and hit refresh after the update finishes.
Secondly, as far as Netbeans is concerned there are at least a half a dozen pages worth of forums posts and various methods for using the Android SDK with it that are also available through Google, I'd give it a look.
I generally do the above step of turning off Automatic build and also try to have not more then 1 open project in my project list.
I myself am fed up of Eclipse from this. Importing a big android project 'ALWAYS' hangs my eclipse and i have to force close it and restart it.
P.S. I really wish google would create an Android plugin for Netbeans =(