My app is not running but there are no errors - android

My app was running perfect until i added a new graphic background in a button.From this time i m getting a message when i m trying to rum my app "You project contains error(S), please fix them before running your application". I have tried to clean my app, refresh it but nothing changes.Also,in the package explorer there is no red sign nowhere in that project....I import the same project in my Macbook and its running with no problem.So,where is the problem in that pc eclipse?Thanks

I recently had this issue. The issue was caused because my debug certificate had expired. So what I did was go to the .android location in windows and delete the file debug.keystore.
After deleting, I cleaned and build my project, this fixed the issues. In my machine this was the location of the keystore, you might need to search
E:\Users\blessan\.android

reference entry of any updated file is still not updated , so R contains error . i know in gen folder R is not red crossed .
work around is open recently changed res files (layout/values ) make little changes (so that new reference can be saved ) and save it . now clean and build .

I also encountered same problem. When I tried to run my project, the error message is displayed "You project contains error(S), please fix them before running your application". But when I build the project, there was no error and same error again on running my app.
So, I went to Build Path -> Configure Build Path -> Java Build Path, and there was an extra entity other than Android 3.1(in my case). So I removed that and application runs good.

Related

Android build error using NativeScript Sidekick: app:mergeDebugResources

I'm building an app with NativeScript using TypeScript and Angular. This has happened twice while building the app.
In order to add resources (like images), I add them to my_app_folder\app\App_Resources\Android\src\main\res. I accidentally added a folder called "video" with a file called "sample_video.mp4" into the res folder. When I tried to run my app on my Android emulator using the cloud build, I received this error in my NativeScript Sidekick console:
/mnt/storage/builds/_/b10d99b4991d936c4896cd72f0628901fa996d4c/4.2.4/saintstanreal/platforms/android/app/src/main/res/video/sample_video.mp4: Error: The file name must end with .xml
I realized I had placed the file in the wrong place, deleted the video and the video folder, and tried to build the app again, but now I am consistently getting the above error, even though the offending file is long gone.
This has happened to me before (with a .png file with a capital letter in the name, which android does not like) and I would love to know why. Last time I had to delete my whole project, revert to my previous commit, and rebuild the app, which is frustrating.
My app ran perfectly fine before I added that file, so I know that the problem is not being caused by my code. I tried deleting the android platform and reinstalling it, to no avail.
Any help would be amazing as I am very confused as to why the file, which is no longer in my project, would continue to cause this problem.
Try a clean build to reset the data that was cached.
In Sidekick go to Build and from the menu options check Clean Build
When you enable the Clean Build option, any previously cached data
will be ignored and the application will undergo a complete rebuild.
This type of build will not take advantage of certain optimizations
and may take longer to finish.
As of the resolution of this issue in NativeScript Sidekick, using File -> Clean Cloud Workspace fixes this problem.
If I add an incorrect resource file to Android's "res" folder, try to build (and fail), remove the incorrect file, and use the "Clean Cloud Build" command, the Android cloud build will then work as intended (without having to use the "Clean Build" checkbox when building).

eclipse android res folder warning

im new to java (and android for that matter)and recently i got tons of errors on png,mp3 files in my res folder which i didnt have for weeks before . I aslo got random errors in my class files out of nowhere even though I did not update my SDK when that happened.
Eclipse throws unwanted error and warning some times because of auto scripting. Some ways to rectify errors and warnings are,
Try to do project clean (Eclipse Toolbar->Project->Clean)
Fix Your project Properties (Your Project rightclick -> Android
Tools -> Fix Project Properties)
If Nothing change just Restart your eclipse.
The file name must contain only [a-z0-9_.]. You must not include any capital letter in Res name.
You can always see error in error/problem window.
Uninstall and reinstall eclipse.
The reason for this error is unknown to me. Do remember to save your workspace folder before you proceed to uninstalling.

problem in building workSpace in eclipse

I am developing android application using Linux SDK in Eclipse. When i build my application its showing error as follows,
Errors occurred during the build.
Errors running builder 'Rpmlint project builder' on project 'Writing'.2
After this problem occurred , when i ran the code, its not running, and so i have to run once again for getting output. what is the problem? how to solve it?
When i googled, some one suggested to close Eclipse and restart it again. I have tried all those things but my problem persists.
Thanks in advance.
Try checking whether all of your assets are available, most of the problems I had using the SDK were due to the R.java file not being regenerated. Whenever the builder can't find an asset the building stops.
I had the same problem, solved removing the Rpmlint Warnings.
To remove the Rpmlint Warnings:
Select the project in the "Project Explorer"
Right click on the selection to open the contextual menu
Select the entry "Add/Remove Rpmlint Warnings" to remove the warning

Your project contains error(s), please fix it before running it

I am developing a simple Android application. But when I run Eclipse, it shows the following error:
Your project contains error(s), please fix it before running it.
I can't find any error in my project or there is no error in my application.
There is a red cross under the application name but it is not under another file name.
Does anyone else have this issue?
That usually comes from errors in the build path.
If you're using eclipse, there is a view you can add that lists all the errors called "Problems":
Otherwise, you can try to clean the project, and that usually solves a few problems.
Finally, if you add or alter resources from outside your IDE, you'll want to reload the resources and clean.
EDIT (Comment by anonymous user)
This can also be caused by an out of date "Debug Certificate" fixed as follows:
IF ALL FAILS THEN THIS GOTTA BE THE SOLUTION:
Delete your debug certificate under ~/.android/debug.keystore (on Linux and Mac OS X); the directory is something like %USERPROFILE%/.androidon Windows.
The Eclipse plugin should then generate a new certificate when you next try to build a debug package. You may need to clean and then build to generate the certificate.
This is also another fix for the "setContentView(R.layout.main);" error that says it cannot find R.layout.main when it is actually generated. (R cannot be resolved to a variable).
This is also another fix for the error "Your project has errors..." and you cannot find any.
Clean and rebuild are still necessary after generating a new debug certificate.
First go to Window -> Show View -> Error Logs in menu. It will display error logs if you have any. Then try to clean the project and build it again.
Well, in my case some libraries were addressed twice in the:
Project >> Properties >> Java Build Path >> Libraries
I just had to remove the duplicate and it worked fine without any cleanings or refreshing.
I saw this with an existing project. I had made a few edits, but hadn't imported anything new. Restarting Eclipse didn't help.
Project->Clean did solve the problem.
I come across this error often when I import a new project in my workspace.
Reason: Some necessary files (Like R.Java) is not generated in its respective packages.
Cure: Clean and build projects, All the files that needs to be auto generated will be there on place after building the project.
Best Luck.
This is happened to me. After format of my system,
When i import project it shows same error
remove first debug.keystore file then goto -
Project -> Project properties -> select library -> remove -> add again libraries.
It's working for me......
Go to projects menu, click on clean menu item.
After that close the eclipse and reopen and try compiling..
It is software glitch you find some times.
it can also happen if you move required files. Simply check Problems View (menu window -> show view -> Problems) as told here
I had this exact same problem. One solution that would work would be to create a brand new project, but I don't think there's any need for that. For me the problem was that the debug certificate that gets auto-generated had expired. Deleting this file allowed Eclipse to rebuild that file, which solved the problem. You can't run an app with an invalid certificate, whether it be a debug or release certificate. Note that cleaning my project did not work. For more information, see:
"Debug certificate expired" error in Eclipse Android plugins
Recently I came across this error. I was really in a corner with no help, then I figured it out. This error can occur for the following reasons:
An error in the project code
Improper linking of external library files to the project
Most important: if your debug.keystore file is expired.
The first 2 cases are easily identifiable but the third one is like searching a black box in a dark room.
So in addition to Project -> Clean, remove your debug.keystore file also.
I am using Mac + Eclipse so to remove, I wrote the command rm ~/.android/.debug.keystore in a terminal.
Is there a way to ignore existing errors in project. Something similar what eclipse allows in case of java projects.
In my case the errors exist in jni directory. The errors are shown even though ndk-buid succeeds. So all i want to do is to ignore the errors reported by eclipse.
If the errors are indeed errors then i should get unresolved symbols during ndk-build.
I have ensured standard android includes are there in include path.
Also my project is of type android/c/c++.
I have two builders associated with the project
1. statndard android builder
2. custom ndk builder that ive explicitly created.
Simulate your self some error in class. Then save it and it would show more errors than you simulated. For me it was incorrect import and this helped.
I have had a similar problem.
Under "problems" tab I have found an error saying "Error generating final archive: Debug Certificate expired on 2/22/12 1:49 PM"
So my advice is to look in the problems tab to get some more info.
Bye
If none of the above solution work, you should check the READ ONLY property of the Project folder, if it is Read-Only, the compiler will not be able to overwrite the resources, R.java and other dex APK etc files and hence this will occur..
This happened to me and I fixed after a long struggle..
Happy Programming.
For some reason eclipse only showed a ! error on root and didn't specified what error it was.
Go in Windows -> Show Views -> Problems. You might find all previous errors there, delete them, do a clean build and build again. You'll see the exact errors.
Eclipse shows an error on android project but can find the error
I had this exact problem when trying to run the Doodlz app, from the book Android for Programmers, on Mac OS X with Eclipse Juno.
After downloading and unzipping the demos from the book, I forgot to change the permission of the files. They were read-only on my system so this was the first issue.
The second issue was solved by selecting a build target on Eclipse. This was fixed by going to: Project > Properties , and clicking the Android field on the left panel to be able to select one option as the Project Build Target, which in my case was:
Target Name Vendor Platform API Level
> Google APIs Google Inc. 4.0.3 15
Then cleaning and rebuilding the project showed no errors.
Finally, to run the app right-click the package (at the Package Explorer tab) and then select:
Run As > Android Application
Simply Deleted my debug certificate under ~/.android/debug.keystore and Project->Clean did solve the problem.
Delete the .android folder from your Documents&settings\User\ on XP and \User\ on Win7. Recreate the AVD again and create a new project.
What caused this problem for me was none of the above, but simply that I'd left the "debuggable" attribute to false in the manifest.xml file after doing a release. D'oh!
Of course neither the LogCat, Error log, Console, or Problems window alerted me to this..
I had the same error, when I copied a project to another computer.
I then checked all properties of the project on both machines, and the only thing that was different was the order of items in Java Build Path - tab Order and Export.
I moved the items Android X.X.X and Android Dependencies above the other 2 in the list (in my case, src and gen folders) and voila, it worked again!
I'm not really sure if the different order was actually the problem, but at least changing it (and saving the properties again) seemed to help...
I had the exact same problem after updating the SDK and ADT.
My issue was resolved by deleting the .android folder (hidden) under C:\Users\USERNAME\
This happened to me when I was experimenting with Maven.
Right click project -> Maven -> disable maven nature
corrected the problem for me.
Yes, this is a rather cryptic message. If you've got a faulty project (say one you've been working on in the past) then you'll get this message (and no messages in your current project's Problems / Error Log panes).
You may just want to run your current project. This may be perfectly fine. Just click on the down arrow to the right of the Run button to select your project.
Try changing your workspace. I am not sure this is the exact solution . I did face the same issue for sometime untill i changed my workspace.
In my case, it happens with ADT 22.
I choose not to create Activity.
After I remove the "appcompat_v7" as library project. I works.
I had similar problem where I couldn't run my project yet didn't see any problems in the code. In Error Log panel it said something like "Cannot add P/ to the list of segments P/ in as a parent".
Restarting Eclipse solved the problem.

Error "Failed to load properties file for project 'MJAndroid'" in eclipse

I have Downloaded an example "MJAndorid" from the O'reilly.
But after importing the project into workspace, m getting the below error log:
Failed to load properties file for project 'MJAndroid'
I am not able to apply the build target, Google API version 3 , in this case.
Also, by clicking on Android in the properties window of the project, I'm geting "The currently displayed page contains invalid values".
Can someone please suggest anything?
Thanks!
On my Mac with Eclipse and the Android AVD exited
I deleted all projects in my workspace (backup first!)
recreated it with the same workspace name and
finally restarted eclipse and a new project setup works fine without the "Failed to load properties.." msg.

Categories

Resources