I just copied an Android Studio project into a new folder and want Android Studio to work on the new folder from now on. Unfortunately the layout files are not correctly displayed (I only see a grey layout without any elements) and I get the message that "This project does not use the Gradle build system". I do not undestand why this error occurs. I have not added or deleted anything from the original files and projects. I invalidated the cache and restarted but the problem still exists.
Does anyone have a clue what I have to do? I'd appreciate every comment.
Do you have an idea what the problem might be and what I have to do. I'd be quite thankful for your help as I do not know what to do.
Related
I'm trying to create an icon for our Android app. The png is created and was put into the proper folder of my project so it can be batched with the batch file. Up to now, everything was fine, but I did a new image I wanted to test on the emulator, but now, although the image is in the appropriate folder and my batch file configured correctly (it works for our 2 other identical projects), it won't take the new image and the previous one I tested keeps being batched despite being deleted (the .apk and key generated with the previous image were deleted as well) and also the app was removed from the emulator. Any ideas what could cause this? Also for some odd reason (I haven't touched the code of the project for well over a week), I ended up with this error "LanguageURL cannot be resolved or is not a field", I managed to fix it by copying the same line from the same project. Would that have anything to do with it?
Thanks for the help
Happened to me before... Are you sure the icon fits the specs?
Look here: http://developer.android.com/guide/practices/ui_guidelines/icon_design_launcher.html
I noticed today in one of my apps that when I loaded a new Intent for a certain few classes(these classes are determined from the click of an object on a Spinner), the layouts appear and they are like the original plain layouts I started with in my project, not the ones I updated and changed to make look better.
I checked all my code and everything, there are no xml files for what it's loading(they are old ones that I had used before). I don't understand why these old, non existing xml files are even loading. It should be loading the current ones I have in my project but it doesn't... Can someone help me with this problem? Thanks
If you're using eclipse, you can try doing Project > Clean, and then Refresh your project. This should make sure you are building with the latest resources.
I am new to Android development.
I created an Android project, and imported some images as resources.
Unfortunately, one of them contained a capital letter, which is illegal. I have first renamed, then removed the offending image. Then I delete all images, but Eclipse still insists they are there after clicking refresh refreshing and running clean several times.
Could anyone tell me how to fix this?
If the file actually exists in your workspace . Just Right Click the file and select Validate . It should be alright
The side bar in eclipse shows a red cross on the title of my project folder but there are no such signs in the directories below it in hierarchy. In which particular file does error exist? How can I know that?
Error log shows: Current file is not a match for the given config.
Sorry I just came across this now, but I've had the same error too, so I'm sure others have. There was a quite a bit easier solution than what you had to do, at least in my case. I had the exact same problem, where my main project said there was an error, so I couldn't debug or run, but there was no apparent error, other than the red X on my main folder.
In order to solve this, I simply closed the project by right-clicking on the main folder, and selected "Close Project". Then, I right-clicked on the closed project, and selected "Delete". Don't worry, this will not delete any files, it will only remove it from the workspace, and will make sure you really want to do that by asking you to confirm. Now, just click on File->Import and select "Existing Projects into Workspace". Choose your parent folder for your app that was erroring, and import it. The few times I've had the phantom error on my main app, this has fixed it each time.
Whether there is an underlying cause and this process simply refreshes something in the workspace, I'm not sure, but at this point this fix is fast enough for me to use it.
Hope this helps next time!
Project -> Clean
Closing project and opening it again fixed it for me.
formed a new workspace and formed a new project. Added each file individually. Now it shows no error.. but still can't figure out what was wrong with thr previous code..? :=(
I faced the same issue..
there was a problem in manifest xml..
the path was not set properly. there may be space in the path..
I just copied the activity tag from other project and pasted in my project and just edited the path in android:name. it worked fine..
When I add drawable resources to my project they do not show up in the list of drawables in the Reference Chooser. I checked the R file and there are references for the files.
I have tried refreshing the project, cleaning the project, and fixing project properties and nothing seems to help. Sometimes a couple will randomly show up in there, but not all of them.
The only consistent way I can get them to show up is to restart Eclipse.
Any ideas?
Thanks
Edit: Further findings:
After some trials, I found an other inconvenient work around to he issue. Turns out when importing multiple files into the project at once, Eclipse will only add the last one imported into the reference chooser. So when I imported my images one at a time, they all show up properly!
Like I said, inconvenient considering the amount of images I have left to import, but maybe with this new information it may help nail down where the issue may be and a possible fix.
I too faced the same problem. I added an image to the res/drawable-hdpi folder, cleaned the project and was able to see the name of the image in the left pane in Eclipse. But when I tried to use this image using Reference Chooser and looked under Drawable, I didn't find it.
I simply exited from Eclipse, and started it again. It was there! Like many things in computers, problems can be resolved simply by restarting!
The only way I found to fix this is to include the generated R class itself.
I found out some new info again.
Since I am doing a port from Blackberry, almost all of my images' filenames have uppercase letters in them, so I end up importing them all and then having to rename all the images after they are imported into the project.
I tried renaming all of my images before importing them all into the project. To my delight, all of the images showed up right away in the reference chooser! So it seems there is a problem when you import files and they cause errors with your project and allowing all of them to show up in the reference chooser.
So if you have to rename files, do it before import!
I'm just not entirely sure that this is the only cause for this issue but it has solved the problem for me.