Android SDK 18.0.0 causing Eclipse Errors - android

I cannot open my eclipse projects with the new SDK(18.0.0)
I get Java errors, and I know its the SDK because I am able to use eclipse without updating, but the old SDK vanished and I am forced to update to continue with my app.
Here are the errors
OnStartup:
An internal error occurred during: "Initializing Java Tooling". java.lang.NullPointerException
When closing
Problems occurred while closing java.lang.NullPointerException

Do not delete all the full .metadata
Backup .metadata
delete only .metadata/.plugins/org.eclipse.core.resources/.project
restart eclipse
Observation : the projects folders are created
Further - if you are using svn/git/hg have code repository links it would be destroyed, so to reinstate
close eclipse
copy relevant projects from backup to merge with current projects in .metadata/.plugins/org.eclipse.core.resources/.project
restart eclipse
Downfall - sporadic fail error may occur (sync or something) - harmless

Did you update the ADT-Plugin?

I've solved it by closing all the projects in the workspace and opening only those that I need. I haven't found out the real reason, but at least I can work on.

Related

Android Studio: R.jar: The process cannot access the file because it is being used by another process

After a new installation of Android Studio 3.6.3 (portable). When I try to build and run my project, I keep getting
app\build\intermediates\compile_and_runtime_not_namespaced_r_class_jar\debug\R.jar:
The process cannot access the file because it is being used by another
process.
Not sure what it wants from me. I run Android Studio "as administrator" and even closing the project and reopening it, the first time it runs, the second time I get the error.
I tried invalidate caches and restart, I tried deleting folders under app/build but it seems to come back. What am I missing?
Thanks
Update:
When trying to clean the project, I get the following
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:clean'.
> Unable to delete directory 'C:\Users\name\Downloads\portable\android-studio\projects\appm\app\build'
Failed to delete some children. This might happen because a process has files open or has its working directory set in the target directory.
- C:\Users\name\Downloads\portable\android-studio\projects\appm\app\build\intermediates\compile_and_runtime_not_namespaced_r_class_jar\debug\R.jar
- C:\Users\name\Downloads\portable\android-studio\projects\appm\app\build\intermediates\compile_and_runtime_not_namespaced_r_class_jar\debug
- C:\Users\name\Downloads\portable\android-studio\projects\appm\app\build\intermediates\compile_and_runtime_not_namespaced_r_class_jar
- C:\Users\name\Downloads\portable\android-studio\projects\appm\app\build\intermediates
If I wait for several minutes, for example, the time it took me to update this question, then it works again...
update:
Updated to Android Studio 4 and the same problem occurs.
Try
taskkill /im java.exe /f
in cmd (windows 10)
I encountered the same problem but on Android Studio Arctic Fox while working on a Jet Compose project.
I simply changed the run configuration and the build error was resolved.
Change DefaultPreview to app and the issue is resolved.
Killing the "OpenJDK Platform binary" process from Task manager worked great for me.Thanks to Abed Murad, which I saw on his link. (I have no reputation to cast a vote yet - my bad!)
It's an internal bug in AS, I reported it as a bug, you can follow up here
https://issuetracker.google.com/issues/167701947
I used to try to delete the file R.jar on ...\app\build\intermediates\compile_and_runtime_not_namespaced_r_class_jar\debug and when it's locked, I had to close Android Studio then delete R.jar before reopening the Android Studio.Is it (killing the "OpenJDK Platform binary") the best solution? I don't know, however, it's what I got for now. Once I get a better one, I'll update it. Luck there guys!
It's an internal bug in AS, I reported it as a bug, you can follow up here
https://issuetracker.google.com/issues/167701947
Try removiong all *.xml files from %USERPROFILE%\AppData\Roaming\Google\AndroidStudioPreview2020.3\workspace
I figured it out from this google issue.
I had the same issue all I did remove R.jar and re build my project.
Invalidate cache and restart solved my problem

Can not Clean Project on Android Studio

When tried to clean the project using options provided by Android Studio IDE. I get following errors.
Errors occurred during the build. Errors running builder 'Android
Package Builder' on project 'appcompat_v7'. Problems encountered while
deleting resources. Could not delete 'C:\Users\Felix Manford
Esq\Documents\Workspace\Ghtourwall\appcompat_v7\bin\appcompat_v7.jar'.
Problems encountered while deleting files. Could not delete:
C:\Users\Felix Manford
Esq\Documents\Workspace\Ghtourwall\appcompat_v7\bin\appcompat_v7.jar.
Problems encountered while deleting resources. Could not delete
'C:\Users\Felix Manford
Esq\Documents\Workspace\Ghtourwall\appcompat_v7\bin\appcompat_v7.jar'.
Problems encountered while deleting files. Could not delete:
C:\Users\Felix Manford
Esq\Documents\Workspace\Ghtourwall\appcompat_v7\bin\appcompat_v7.jar.
I observed it was right after i set up my image button; which i don't get because i did everything correctly.
I observed it was right after i set up my image button; which i don't
get cos i did everything correctly
No This is not due to this issue. The error is not a syntax issue, It is a development environment's Build issue.
There are several things that you can do to kill the process that prevents the cleaning of the application to work.
Close the IDE and then start it again. This will kill the currently running Gradle build tasks. which will prevent these jar files being deleted during the clean up.
You can invalidate the IDE using the following option,
Even if that is not working, You can kill all the JVM processes that runs on your computer using the task manager,
If that does not solve the issue, You can try restarting the computer as last resort.
I do not expect that you get to this one. But If any of these things did not work, then there is something wrong with your IDE or JVM, Try to reinstall IDE and see,

Can´t Run or Export Android Application after incorporting Facebook sdk to my project

I don´t know what I did... Everything was working well, had to battle a while to get facebook login working, and doing what I wanted to do... Finally it was ready, so I proceeded to Export Android Application... First error had to do with Dalvik code error 1 something... So I look for duplicates .jars in my folder, erased libraries in java build path, cleaned the project, etc, as proposed in some stackoverflow answers...
Stopped getting that kind of error but now I can´t even Run the application, now I get some errors like: Unable to execute dex: GC overhead limit exceeded, or: Unable to execute dex: Java Heap Space.
In my windows machine it gets stuck until some memory related error is displayed... in my Mac the Eclipse is forceclosed in most occasions ... I tried to roll back and took off the facebook sdk part, but nothing, now I can´t run/export my app even as it was before... I guess I did something wrong in the cleaning or something in the Eclipse parameters..
Please help, I´m dying here.. Thanks.
Answering myself to help others:
1.Check there´s no duplicate .jar anywhere in your project.
2.Go to eclipse.ini in your Eclipse folder, and modify to this, or greater:
-Xms512m
-Xmx1024m
3.Save and restart Eclipse
4.Go to Project -> uncheck Build Automatically
5.Go to Project -> Clean... , clean both the library project and your app project
6.Export your app as a signed APK while Build Automatically is still disabled
7.Re-enable Build Automatically and everything should be back to normal as before

Gradle: error: illegal unicode escape

I recently updated to the most recent Android Studio version (0.2.x), and I am experiencing an issue where I cannot build the project. I receive an error message stating:
Gradle: Execution failed for task ':TestApplication:compileDebug'.
Compilation failed; see the compiler error output for details. C:\Users\user\AndroidStudioProjects\TestApplicationProject\TestApplication\build\source\r\debug\com\example\testapplication\R.java
Gradle: error: illegal unicode escape
Now, I understand I was supposed to reinstall Android Studio as per instructions:
Windows users: Do not install Android Studio 0.2.x in the same location as 0.1.x.
Doing so may cause errors such as ClassCastException or other unexpected behaviors.
It's best if you remove your previous version of Android Studio 0.1.x.
And I actually did, I uninstalled Android Studio, and deleted the remaining folder (Which is apparently not deleted after uninstall) stored at: C:\Users\user\AppData\Local\Android
I then proceeded to clean the registry entry just in case (I tried this on my 3rd attempt after not getting it to work), and rebooted before re-installing.
After the PC rebooted, I proceeded to do a fresh install of Android Studio, it installed successfully. I created a Test Project from scratch (to make sure it was not a problem with opening previous projects), but right after it opened the project it's already showing the build problems. I tried running it and it simply won't compile.
What's even more strange is that all of the problematic lines according to the compiler output are commented lines in the R.java. Here's one:
/** From: C:\Users\user\AndroidStudioProjects\TestApplicationProject\TestApplication\src\main\res\values\dimens.xml
And it points to the character 30 of that line, which is right between the u and the s of the word user (image attached). I actually tried deleting the comments, but as you'd expect the R.java was generated automatically when I asked for the project to be rebuilt.
I have absolutely no clue what the problem is, any ideas?
Known issue. We have fixed it internally already. Should have it out very soon (couple of days max)
I had the same problem and I was using a path similar to yours.
What I did was move the project to the root of the C drive, so the path doesn't start with "C:\Users\user" anymore and the problem is avoided... Not really a solution, but a workaround.
PS: This is not really an answer, but I don't have enough points to comment yet and this might help someone.

Cannot create new Android application project or access Android preferences using Eclipse Kepler

I am using Ubuntu 13.04 and Eclipse Keplar.When I try to create a new Android application project the following message is displayed:
The selected wizard could not be started.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.
An error occurred while automatically activating bundle com.android.ide.eclipse.adt (241).
I cannot access the Window->Preferences->Android page,when I try the following message is displayed:
Unable to create the selected preference page.
An error occured while automatically activating bundle.com.android.ide.eclipse.adt.
No updates for the ADT plugin or the Android SDK were found.
What should I do to restore the ADT plugin to good working order?
Thanking You
Ran into this same problem today running a Windows 7 machine. It has been a while since this question has been asked, but having an answer here might prove useful since this thread is ranking highly on Google for the error message:
I found that cleaning all projects in Eclipse and restarting it once it was finished solved the issue and I was able to successfully create a new Android project afterwards.
Eclipse menu: Project >> Clean
Similar problem/answer found on stackoverflow.
From console, run eclipse -clean (you'll need to make sure eclipse binary is in your PATH, or use full path to the binary).

Categories

Resources