error in running android project - android

when i'm trying to run an android project which shows the warning message :
Your project contains error(s), please fix them before running your application.
but there's no error showing in the code or other section on the project except the project name. like :
I've cleaned, refreshed the project but it remains same.
how can i identify and remove the error ?
thanks in advance

All errors and warnings with detailed description could be found on "Problems" view - usually a tab in the bottom right part of the eclipse window. If it isn't there, use Window -> Show View -> Problems to show it.

Let your tooling generate a new certificate by deleting your current certificate, see:
"Debug certificate expired" error in Eclipse Android plugins

Has the project worked before, but suddenly stopped?
Have you changed anything in the res folder? I've found that if you mess up one of your resource files (drawable, layout etc) it can have this effect. Double check to make sure none of your resources have spaces or capital letters in the name. If you have recently added a new drawable, try removing it temporarily to see if that fixes your problem.

Right click your project, click Properties and choose Java Build Path. Check the tabs there and see if you see any errors.
Sometimes resources there go missing due to folders being removed / moved causing the problems you're experiencing.

Related

Android Studio cant find the project properly

This problem happened like "out of the blue". When I tried to run the application at some point it came up with
configuration is still incorrect. do you want to edit it again
This message kept popping up, which I thought was a bit weird. So I endend up restarting Android Studio, but when it had loaded up again, all of the structure with folders etc. in the left side of the screen, were gone. Only a message saying "Nothing to show" is there now.
Also all of the files that were open before I restarted is still open, but has little "red J's" in the tap where the file name is.
The last edit to my project was that I changed the minimumSdkVersion of the gradle file, from 21 to 10.
Obviously changing this back, had no effect.
EDIT:
When I try to deploy the project anyways it gives me this error in the console:
Error running main: Module is not found
So I have really no idea on how to fix this or what is wrong, even though I have tried to research it.
I really hope someone can help me out or have an idea on what may be wrong.
Any help will be greatly appreciated.
If you build and deploy Android app from IDE/Studio to watch directly , you most likely will see Build Configuration screen and if you will clik "Run" you will get
"Build Configuration is still incorrect, do you want to edit it again?"
To solve it just check "Do not launch Activity" in Activity section of a "Run/Debug Configurations" of project.
or try these
check for the tags they may be not closed.
check for the package name in manifest file
check for the edit configuration , Then, check the bottom section "Before launch: Gradle-aware Make"
click on that small triangle to hide it. An error message should appear. This message may show you the error cause.
or Go to File->Project Structure-> Project Settings -> Modules, Click on the green colored and add new module. select Application module and set the content root to your project module.
or try to update the gradle as when studio starts it looks for gradle and sometime if not found it download it, may be your gradle have crashed so update it or manually place it.

Error in Eclipse when trying to export apk

I'm trying to export my game apk for publishing to the store, but then I get an error saying 'compilation issues', how do i fix this? I've tried everything, it still doesnt get fixed, and when i go to my project theres a red x over my project, i'm guessing this might be the error, please refer to the screenshot
http://postimg.org/image/osiir584t/
Follow the Steps :
1.Remove Automatic build selection
2.Clean your project
3.Build the project
4.Export the apk
First fix your project's error then you can export it.
Fix your project code(Make sure that don't present any error) that gives compilation error.
Clean your project
Then export for publish your app..
Well, unsurprisingly this means the compiler runs into problems when compiling the release apk. These errors should appear in either the 'Problems' view or one of the consoles (you may need to switch between them). Finding those will help track the actual problem down.
Also, since you mentioned changing package names you may want to check my answer here: Serializing CDT Project settings has encountered a. I'm fairly certain that changing the package name for my project was what caused Eclipse to corrupt my project configuration back then.

Eclipse displaying error but not giving error in console

I am trying to run my application but it is displaying error in the project explorer
I had try to clean my application many time even restart the eclipse but no effect
It is displaying error and also it is not giving me any error in the console.
How to fix this issue?
EDIT
And also I remove all the reference lib and add again but still getting error.
Please follow the steps on this link. That user has the same problem. I have given answer there.
EDIT
solve this issue by following below steps
Go to Window => Show View => Problems
Now I can see the error like debug certificate expired
Now Delete the file ~/home/.android/debug.keystore
Clean Project
For more information refer this link
Check the problems and fix that. To view the problems == Window -> Show View -> Problems
i think the problem in the added library function, check the library files what you had added to this app. it shows error there remove it once and add again..
or
rightclick-->Android Tools --> Fix Project Properties..

What can I do with R cannot be resolved problem?

If I make a new Android project in Ecplipse and I try, to open one of the samples from android SDK, I have got an error, look like this:
R cannot be resolved
What can I do, to be able, to run these files? I tried to delete import android.R; but nothing changed.
Thanks
First thing you might try is "clean" your project (option in the menu). If it persists:
There should be an error that stops R from being generated. Check the "problems" tab (?) in eclipse to see what that problem is, and solve that. It could be missing libs, or various other stuff.
You possibly got error in building resources.
Possible fixes:
-refresh your project (F5)
-clean you project and refresh
-see "Console" tab, sometimes the problem is shown there
-reload the Android SDK
-restart the Eclipse IDE
Check your XML-Layout files. The problem come here half a time.
If you are sure it is note your layout file, check in your java build path if the google librarys are well set. (Google APIs)
(sorry for my bad english)

Android Packaging Problem: resources.ap_ does not exist

I am trying to fix a problem in Eclipse for like 3 hours and I haven't made any progress. Tomorrow is the customer coming to look at my app, and I have no time left. This is really frustrating!
This morning when I was coding and I wanted to run my app on my device Eclipse crashed all of a sudden. 'aapt.exe has stopped working'
After this Eclipse wasn't starting anymore. It froze at the splash image.
I looked on the internet and tried different solutions like going back to Java SE 6 update 20, changing .ini file etc. in the end reinstalling Eclipse did the job.
Shortly after that the 'aapt.exe has stopped working' returned. I found a solution by changing my projects target. 1.5, 1.6, 2.2 doesn't matter, as long as it's different than the one before.
Now I get the Error generating final archive: java.io.FileNotFoundException: C:\xxx\bin\resources.ap_ does not exist error.
I tried clean but that doesn't work. Deleting and automatically regenarting R.java also didn't work.
I ran the same code in Netbeans with the Android plugin and there it gives me the 'aapt.exe has stopped working' again :(
Please guys, how can I fix this?
Edit:
I think I may have found the reason. These are the error lines in the console:
org.xmlpull.v1.XmlPullParserException: Binary XML file line #3: <bitmap> requires a valid src attribute
at android.graphics.drawable.BitmapDrawable.inflate(BitmapDrawable.java:341)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:779)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:720)
at com.android.layoutlib.bridge.ResourceHelper.getDrawable(ResourceHelper.java:150)
at com.android.layoutlib.bridge.BridgeTypedArray.getDrawable(BridgeTypedArray.java:668)
at android.view.View.<init>(View.java:1846)
at android.view.View.<init>(View.java:1795)
at android.view.ViewGroup.<init>(ViewGroup.java:282)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
[2011-01-17 16:37:20 - gegevens.xml] Unable to resolve drawable "com.android.layoutlib.utils.ResourceValue#267e33de" in attribute "background"
The file it's talking about is 'bg.png'. It's a small png file which I repeat in a .xml file.
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="#drawable/bg" android:tileMode="repeat" />
This file has worked from the first time without any problems.
I deleted it from the drawable folder, waited for an error message, and then added it back. The red x next to the foldername got away, but still nothing different...
A shot in the dark, but if it's just the one PNG file could you delete it from the project and add it back? There must be something breaking the resources file.
I just encountered the same error after performing an SDK update withing Eclipse (Indigo). Normally I would either delete the errors and try to rebuild or clean with success, however this time it didn't fix the problem.
Finally I went to the android sdk folder and manually updated. Upon coming back into eclipse I got the error again, but without rebuilding or cleaning I was able to launch the application onto the device by pressing play for a second time.
EDIT:Apparently this problem is intermittent, as I am now once again unable to run on the device, or export the signed apk.
SOLVED: The problem stems from a corruption in the .metadata folder. I discovered this by re-installing Indigo, but when doing so I didn't remove the original workspace folder. The problem of course showed up again. I deleted the .metadata folder completely, which effectively resets all of your eclipse configuration settings. All deployments and signing work flawlessly now. Just had to setup the environment to my liking again, which takes a few minutes as opposed to the hours I spent troubleshooting this.
I just ran into this same problem after importing my project from another machine, but didn't have any errors in the console like the OP. I unchecked Project->Build Automatically and then did Project->Clean and this solved my problem. I was actually missing several files in the bin/ directory for my project and this fixed them all.
I think this error can come up for a variety of reasons. The following solution is only known to be specific to the same error message appearing when using ADT 14 (released yesterday) with build output set to Verbose:
I ran into the same error using Eclipse 3.7 (Indigo) after upgrading to ADT 14 and SDK 14 on all projects including newly created ones. I found a workaround someone posted on the ADT bug tracker, which is basically to switch Eclipse Settings->Android->Build->Build Output from "Verbose" to "Normal". The post is here.
In my scenario, yesterday upon open Eclipse was trying to download updates and I cancelled it since I was using my cellphone hotspot. I tried the metadata folder delete solution mentioned here and didn't work for me. Going to Window->SDK Manager and updating everything seems to be my solution.
I had the same issue in that I added some images into each resource directory and unfortunately named them .png. There were in fact jpegs and the eclipse plugin was flagging this (unbeknown to me in the console)
The issue I found was that if you clear the console then the logging info is lost and it doesn't log anything again!
Changing the extension from .png to .jpg fixed my issue
Above solution didn't worked for me.
The way I did that is updating not only ADT but SDK as well. To do that just go to Android SDK Manager and just download updates.
IT WORKS!
It's very meaningless but changing build mode from verbose to silent did the trick! Nothing else (cleaning project, re-opening , re-installing) did.
Try running clean, but also uncheck build automatically and click "build project" under the "Project" menu. Once you build manually, you can re-check the "build automatically".
I would also shutdown eclispe, and then kill adb
> adb kill-server
Sometimes this error happens when you create ninepatch with wrong black dots/lines. For example right and bottom lines must be solid with no dashes or empty regions.
Try in
windows-> peferences -> android -> Build -> Build Output
Silent
http://code.google.com/p/android/issues/detail?id=20395
In some cases, this error will disappear after fixing upstream errors. In my case that was a version incompatibility in 'fullwebview.xml'.
There, 'layout_width'/height was set to a value not supported in my build target, 2.1. Changing the value to 'fill_parent' solved the issue.
I encountered this same error but then I saw that my layout.xml was not catching an error for a TextView whose android:text="#string/my_unmapped_string string resource was not mapped in strings.xml. So when I viewed the graphical layout it was showing:
Couldn't resolve .....
When I mapped the resource properly and ran the project again, it worked fine and that bin\resources.ap_ does not exist error was gone :)
In my case, it was the file add-icon.175x175-75.png (valid file name, but invalid resource name) copied into res/drawable by mistake. After removing this file, Eclipse did (in April 2015) a few successful builds with incorrect sources, and only then began to behave sensibly, showing me missing resources and malformed XML (I changed the layout).

Categories

Resources