Error on Eclipse ADT while creating an Android Application - java

I've already tried everything I saw in the forum but it seems that doesn't work for me. I really need to finish this project until Nov. 25th but I'm stuck at the creation of the project.
Eclipse is full of errors, like this:
[2014-11-05 20:59:48 - TEXApp]
D:\workspace\appcompat_v7\res\values-v21\themes_base.xml:190: error:
Error: No resource found that matches the given name: attr
'android:colorPrimary'.
[2014-11-05 20:59:48 - TEXApp]
D:\workspace\appcompat_v7\res\values-v21\themes_base.xml:191:
error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
There's a lot of them, I don't know what's wrong since I installed all the libraries.
Here's how I set up the project:
http://i.imgur.com/Ps6JtBU.png
And this is what I get:
http://i.imgur.com/XhMSWo1.png
Some times I delete the components which have errors, but I still get the themes_base.xml errors and my R.java is not generated.
Sorry for the long text but, I don't know what to do, hope you can help me, thanks!

if your application has the reference of the library appcompat_v7, Delete the android-support-v4.jarlibrary of your project under /libs folder, that is already defined into the appcompat_v7 library.
Having two android-support-v4.jar libraries defined into the same project are causing that problem.
Install the last version of the SDK, the problem was solved.

Related

Having trouble setting up Eclipse for android development

I need to set up a workspace in eclipse to edit an APK so that I can mod it. I have the decompiled and deobfed java sources but I have never done this before, and I can't get eclipse working with android. I have installed the sdk and the software for eclipse, but I have some errors after creating a new basic project. Here are some of the many errors, Probably stemming from 1 problem that I just cant figure out.
XML:
Error in an XML file: aborting build.
\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
Among many, many more XML errors that look similair.
Java:
ActionBarActivity cannot be resolved to a type
R cannot be resolved to a variable
The import android.support cannot be resolved
The method getMenuInflater() is undefined for the type MainActivity
There are definitely some jars that should be in the build path that are not there, but I don't know why they aren't there and what is missing. I probably set it up wrong but I tried uninstalling and reinstalling and that did not help.
Sorry for the shitty formatting I have no idea how to format and this is my first question on here sorry!

Eclipse Android Error with appcompat_v7 values-14 and values-11

Im trying to see if I can get my Android App running with API 8. I've changed the build target for the project to 2.2 and I've changed the java compiler to 1.6. In problems I'm getting an error where R cant be resolved (I've checked to make sure my files don't contain import android.R) and in the console I'm getting a lot of red text that says:
[2015-08-02 16:12:13 - my app] /home/myname/workspace/appcompat_v7/res/values-v14/styles_base.xml:24: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar'.
I wont paste the whole console but it goes on like that for almost everything in styles_base.xml and themes_base.xml for values-v14 and values-v11
The only suggestions I have found are to change to a higher build target but I want to see if I can make my program compatible with API 8
I dont know if it's relevant but, I've searched through my project and I'm not using Holo anything either as far as I can tell.
You can keep the minimum required SDK for a project to be API v8 and still set a higher build target. The error you quoted is related to the AppCompat library and not your project. You should have no problems setting a higher build target for the library.

Android Java compiler error (compiling old files?!)

I refactored some packages in my IDE and everything seems to be ok. But when I compile my app I get an error that file x.java can't be read in x.java.
Both files are located in the old packages which do not exist anymore.
The package definition is fine in all classes. Also the Manifest is fine.
I'm using IntelliJ IDEA from JetBrains.
java: error reading K:\APP\src\com\renemaas\android\APP\About.java; K:\APP\src\com\renemaas\android\APP\About.java (The system can't find this path)
I hope someone can help me with this problem.
Note: Yeah I have search for nearly 1 hour to solve this problem on my own. I'm new to Android development.

Importing external library into eclipse - Android

I want to use the UnifiedPreference library in my app. I've imported the library into my workspace, then added the new project into my existing project by adding it as a library under Properties -> Android. However I'm getting the following errors when I try to build my project which are coming from the UnifiedPreference project:
Console:
[2013-04-08 23:06:29 - unified-pref-library] ERROR: In <declare-styleable> PreferenceHeader, unable to find attribute icon
[2013-04-08 23:06:29 - unified-pref-library] ERROR: In <declare-styleable> PreferenceHeader, unable to find attribute title
The relevent logcat errors seem to be:
PreferenceHeader_title cannot be resolved or is not a field UnifiedPreferenceHelper.java /unified-pref-library/src/net/saik0/android/unifiedpreference line 435 Java Problem
PreferenceHeader_title cannot be resolved or is not a field UnifiedPreferenceHelper.java /unified-pref-library/src/net/saik0/android/unifiedpreference line 299 Java Problem
Have I imported the library incorrectly? I've tried cleaning and building both projects without anything changing.
In Eclipse:
On the Package Explorer
Right click in your Proyect > Properties
Select: Java Build Path
Select and enable Android Dependencies
Put on the top in the list
Click: OK
Figured it out, seems UnifiedPreference requires a dependency for ActionBarSherlock. Thanks to tttony for putting me on the right track though.

org.apache.xerces.jaxp.SAXParserFactoryImpl not found when importing Gears API in GWT

I've created a GWT project using Eclipse which was working perfectly (I was able to run it in both Hosted Mode and on Google App Engine) until I tried to import the Gears API for Google Web Toolkit. After adding the following line to my java source file:
import com.google.gwt.gears.client.geolocation.Geolocation;
I get the following error when I try to compile:
19-Jun-2009 3:36:09 AM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: failed com.google.apphosting.utils.jetty.DevAppEngineWebAppContext#1c7d682{/,C:\Documents and Settings\Geoff Denning\workspace\TaskPath\war}
javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found
I've already added the gwt-gears.jar file to my \war\WEB-INF\lib directory, and I've referenced it in Eclipse as follows:
I've even opened the gwt-gears.jar file and confirmed that org/apache/xerces/jaxp/SAXParserFactoryImpl.class does exist. Can anyone give me any pointers as to why I'm getting the above error?
Check that Xerces exists in:
$JAVA_HOME/lib/endorsed
Sounds like a Java 5 issue. Also check the Java system property for:
javax.xml.parsers.SAXParserFactory
It should be:
org.apache.xerces.jaxp.SAXParserFactoryImpl
If not then that's your issue, make sure you set the system property.
Apparently this is a bug in jre 1.5. I was able to resolve the problem by switching my default JRE in Eclipse from 1.5.0_06 to 1.6.0_03, as shown below:
Thanks to Jon and Rahul for pointing me in the right direction.
This happened to me. I had conflicting JARs in my workspace. I removed one and boom it worked. The message didn't lend very well to the root of the error.
My SAXParserFactoryImpl problem was caused by gwt-gadgets.jar I had in my boot class path. Removing this JAR from the boot class path solved the problem for me. Basically you have to remove any JAR containing a SAXParserFactoryImpl class from your build path (user libs).
Remove the $JAVA_HOME/jre/lib/jaxp.properties fixed the issue.
Take a look at Trouble with Selenium (XercesImpl) and Google App Engine.
I had a similar problem with GWT / GAE (SAXParserFactoyImpl not found) and solved it by;
Importing the jar to war/WEB-INF/lib
Adding the jar to the build path

Categories