Just updated SDK and ADT, and running a test project here now, I can't get it to build.
Android AAPT problem "invalid resource directory name", and the problem is desktop.ini which is placed in all of the res folders. It just gets put back if I delete it. The desktop.ini's also prevent r.java from being built as it depends on a clean res folder.
My workspace is on a Google Drive directory if that matters. Thanks!
I use google drive and I come across the same problem, please use windows folder browser search to search desktop.ini in the whole project folder, so that you can select all and delete them all at once. Don' t try to delete one by one in the folder. (I have 1000+ desktop.ini in the whole project)
Related
I have problem with ASSETS folder in android. I put folders and files in ASSETS, and for some folders/files I got FileNotFoundException. Then I printed all folder/file names from ASSETS folder by code, and I saw that not all folders/files are packaged into APK. Why is that happening? All files and folders have names without special characters, example: "Prevoz tereta i lica vozilima/Prevoz tereta i lica vozilima.json"? For some files/folders it works, and for some it doesn't. Does anyone know how to solve this problem? Thanks in advance!
I think I found solution for my problem. Files that needed to be in ASSETS folder were created on my desktop. I created ASSETS folder in Android Studio, but when I was putting files from desktop to assets I didn't put them via Android Studio but Windows Explorer instead. I found location of assets folder and pasted files there, so I think that Android Studio didn't index some of them. Now I created 4-5 files and folders via Android Studio (right click on assets folder -> new -> file/directory), and every one of them is packaged and working all right. So I think that was the problem and the solution. I will have to create every file and folder by hand in Android Studio, then just put data in those empty files afterwards. Thank you all for help/suggestions. I'm glad that I found the solution, even if it's stupid.
I'll make this an accepted answer tomorrow, because stackoverflow doesn't allow me to do so until tomorrow.
You have to somehow refresh your project.
If you are using Android Studio goto File>Synchronize or press 'CTRL + ALT + y'.
Make sure your assets folder is in src/main directory of your project.
file-invalidate and restart
tools-android-sync project with gradle files
READ IF USING IONIC AND TRANSFERRING FILES ATOM/OTHER IDE TO ANDROIDSTUDIO
There's an IDE interface issue.
What worked for me: removing and readding android as such:
ionic cordova platform remove android
(you might have to manually remove android folder from platforms)
ionic cordova platform add android
Then you can move on with generating a release file and then generating a signed apk in android studio etc.
I am using eclipse juno -adt tool Eclipse Platform Version: 4.2.1.
i lost all projects from eclipse project explorer .they doesnt have single line of code. all projects in work space folder have 0kb data(user/workplace). is it possible to restore the complete projects from .metdata or work space runtime.
cd ~/Documents/workspace/.metalog/.plugins
rm -rf org.eclipse.core.resources
i have tried above commands but rm is not recognized .how can i setup path for eclipse.. please help me out..
I don't think that you can get it back, ask experts if you still don't get you may try this, there is 50% chance that you may get .java files atleast.
1) Download recuva
2) Open recuva and select All contents.
3) Locate the path to your workspace.
4) "Deep scan" that may take hours, when you get all the deleted data back, extract .java, .xml files from them.
5) Create a new workspace and add those files, and you can reprogram Manifist files manually. (If you are working on android)
Try manually separating metadata for each package from the metadata folder in your workspace. Once you do that put the corresponding metadata and packages to a separate folder and then in your eclipse choose workspace window select the folder which you created for individual packages. It'll work. All the best.
I have just experienced the same problem. The entire project displays all the files but they are all 0 bytes. Most recent bit bucket sync is not very recent. After cursing and kicking things, I had some luck with recuva. Since it is an android project, I have the latest apk I had installed in my phone yesterday as I was doing the test, dex2Jar and JD-GUI helped a little her, but there are still mountains of code I will never get back.
I had an Android project in eclipse, I then duplicated the project changed some of the code and updated the images, in windows explorer and eclipse the images are updated but when I run the app it uses the images from the original project, not the copy but I want the two projects to use their own images.
Any Ideas? have I missed something I needed to update in the new project?
In the "Build" folder you may see temporary files to build the application. Eclipse does not always correctly updates them because attributes of files may be violated.
If "project cleaning" has not helped you may delete the "Build" folder from the project folder.
I've quite new to Android development and specially Eclipse.
I'm busy on a project called, say 'HelloEclipse'. I've had some major changes ahead, in which I had to some very big changes.
So I made a zip file of c:\workspace\HelloEclipse, placed that in a save place. Went on to work on my project. Few hours later, I wanted to go back to the saved situation. Closed Ecplise, rebooted my computer, because I wanted to make sure there were no locked files. Deleted the old c:\workspace\HelloEclipse folder, place the version out of the ZIP file back.
This resulted in a totally corrupted workspace status. Could not go foward, nor backward. I've ended up, creating a new project, and pasted in everything, took me hours. I think this is quite stupid Eclipse behavior. I've also tried ot, export/import with a archive from out of Eclipse, also not succesfull.
So the two questions;
How am I suppose to save projects (without installing anything like subversion)?
Why is saving the files not enough, and why does that make Eclipse barf?
Thanks in advance!
Dennis
In eclipse if you want to reimport an old project from a ZIP, don't just copy the project files to the workspace, instead, extract the files to a normal dir outside the workspace.
Open Eclipse normally and select File>New Project>Android Project, just as you would to to create a new Android project, but then in the new android project window, you have a radio button giving you the choice to Create project from existing source, point it to the directory where you have extracted your old project and it should be re-imported to the WorkSpace alright.
Or do File>Import>Import existing project into workspace.
But in any case, don't put the files in the workspace manually to avoid conflicts, Eclipse will copy the files it needs itself upon importing.
There are hidden workspace files that you may have missed -- specifically, .classpath and .project. That said, it's a lot easier to make a backup copy (for example, of a released version so you can continue developing while supporting the release) by simply right-clicking on the top-level of the project in Eclipse and selecting Copy, then right-clicking and selecting Paste. The result will be a copy of the project after an opportunity to name the copy.
If you want to zip projects, you can do that by exporting them. If you want to delete existing projects, you should do that from inside Eclipse with a right-click. You can import the zip you previously exported.
If by save, you meant backing up the best something would be to create a local repository. If I were you, I would backup my code in an online repository too; to save it from hardware crashes or other disasters.
In your problem, you could have tried deleting the project alone and import the backup copy(from the zipped file) instead of deleting the entire workspace. Can't pinpoint the exact reason of why eclipse barfed but maybe because it messed up the workspace settings for eclipse. On a related note, I found this on the net.
Eclipse is rather troublesome at times but AFAIK it's the best IDE for android.
First of all, after several months of developing with eclipse I moved to IntelliJ (they have a community edition) and I found it much much better.
In intelliJ you can save local history, for example, you can set-up a label and go back to that label whenever you like without losing anything.
As for eclipse, you probably didn't zip some hidden files or something.
In addition, I remember having some similar problem, I had to resync the files with the project, try this one
Good Luck
I do the same thing with my projects. Instead of going through windows explorer to copy the files, I find copying the entire project from within Eclipse (right click the project in the explorer window pane, click copy, then click outside of the project and click paste) works just fine. When you paste it, you can specify a new save location and project name, which can be your backup space. Then you can switch between versions of the project no problem.
I get this error when I try to clean a project:
ERROR: Unable to open class file ....R.java: No such file or directory
So I can't build my projects any more. But R.java is there in the gen folder and looks fine when I open it.
This happens to every one of my projects. I tried completely deleting the Eclipse folder and reinstalling it (Helios on Windows) and Android ADT. No luck.
I have also tried moving my workspace to a different drive. No luck.
I made sure all folders in my workspace are not read only. This worked the first time, but immediately the error came back when I cleaned my project.
This all started right after installing ADT 10.0. I am wondering if it somehow is building R.java as a read-only file.
EDIT: Is deleting the eclipse directory sufficient to reset all of its configuration?
More info: All my projects are fine, until I rebuild or clean them. Then every class that looks at R.java throws an error.
Did you try to remove "bin" and "gen" folders and after that make clean/build?
I have somehow managed to fix it, but I don't know exactly what did it. Here are things I did.
Deleted eclipse directory and reinstalled it and ADT.
Deleted my original project that was the first to have the problem.'
Created a new project with my original's project name.
Manually copied all my class and res files into the new project and refreshed it.
Pasted the text of the old manifest into the new manifest.
I did all this, because simply importing the original project again didn't solve anything.
After the above changes, my other projects still had the problem after pressing clean on them. But then I could fix those by deleting the Gen folder, and making sure the Java Build Path had all folders checked.
I think format C: and reinstalling windows
will be preferred way to solve this issue :)
now for serious that work for me
install all updates restart eclipse and close your project
restart eclipse and delete gen from eclipse and rebuild your project
if you're having the problem for all of your projects, it could be this:
"Debug certificate expired" error in Eclipse Android plugins
that's what fixed it for me, even though I wasn't getting any debug certificate errors. apparently the debug certificate is only valid for one year.
I found this issue reported for Mac:
But it's the same for Windows, and I guess, for Linux. I've posted there a workaround, very similar to the one by TenFour04, but without the need to reinstall anything:
Delete project from Eclipse;
Delete all project generated and configuration files and folders (bin, gen, .classpath, .project, default.properties);
Go to Eclipse and create a new Android Project (do not import an existing one) choosing your original source files;
Adjust all setting (JRE, libraries, linked files, aspects, etc...)
Clean.
Helo guys,
:) This my solution which work for me fine in eclipse.
First : You need to make a copy of the file who make the problem.
Second : delete this file from eclipse
Third : Project >clean
After you can restart your delted file from the location where you have saved it.
Have a nice day