I am currently working on an Android project, which references some Android libraries.
After importing the libraries as projects in my Workspace, I add them to my project:
Project > Properties > Android > Library > Add..., and I add the needed Libraries. Everything seems ok, as shown here.
However, as soon as I click on the OK button, The appcompat library doesn't seem to be recognized anymore (Build errors still displayed on appcompat's classes, resources missing, etc).
Indeed, the Project > Properties > Android > Library Menu now displays this, showing an error only on the appcompat library.
Am I missing/not understanding something that may explain this behaviour?
Moreover, how can I fix this problem?
[UPDATE] Using Project > Clean, followed by File > Restart, solved the problem.
As I can now close the Android window and reopen it without the library integration failing as before, the problem seems to be definitively solved.
However, I am still clueless: what could have been the cause of this problem?
I had once one big problem related to partitions in my PC. Please, be sure that you have your source code and your libraries in the same partition. It's very important, and I hadn't read before I had the problem.
Copy appCompat library in the same folder where FacebookSDk and
GooglePlayService is there.
Import the appCompat project into your eclipse.
Add as library to you're project. You're problem will solve.
Related
I have just started to use Android Studio, migrating from Eclipse. I encountered a problem right on the start: I want to create an application project for android 3.0 and up. However Gradle automatically include Appcompat_v7 in their dependencies, and the default java code extends ActionBarActivity instead of Activity. I tried to things by delete the dependencies but everything just went berserk, so I am here to ask you guys what is a possible fix for this. Thank you very much.
Edit: I thought you were using eclipse. But let my answer stay here so that someone using eclipse may see the solution.
When creating the project please make sure you unchceck the "Create Activity" checkbox. This way you can prevent Appcompat_v7 to be added automatically.
guys, with my friend started working on a school project - developing a java app for android. He started it, now it's my turn to do my job, so i got the code he already has, set up Android SDK for Eclipse and downloaded all the neccessary files and packages, but it still gives me errors and I can't even run the project.
One of the errors (the main one, I think) is that it can't import android.support.v7.app.ActionBarActivity
If anyone knows what can I do (I've tried all kinds of solutions from the internet, but none work) I would be very grateful.
Here is a screenshot of the code
http://s17.postimg.org/8aw952lha/Capture.jpg
See if you have imported the ActionBar project to your Eclipse workspace, also, right click on your project->properties->android and check that you have referenced/linked the ActionBar project there.
If you are using a repository without the proper ignore files it is possible that you have imported your partners configurations and then have the references to the auxiliary projects broken (you just need to update that).
Hope it helps.
android.support.v7.app.ActionBarActivity is a support library. This allows older versions of Android (before native support for an action bar was available) to use the action bar.
Since you are having difficulty importing it, I'd assume you do not have the support library installed.
Full instructions are available here:
http://developer.android.com/tools/support-library/setup.html
A snippet for adding support libraries to Eclipse:
Make sure you have downloaded the Android Support Library using the SDK Manager.
Create a libs/ directory in the root of your application project.
Copy the JAR file from your Android SDK installation directory (e.g., /extras/android/support/v4/android-support-v4.jar) into your application's project libs/ directory.
Right click the JAR file and select Build Path > Add to Build Path.
Im using eclipe,
Following the EXACT guilds of developers.android.com , just doesn't work.
I just want to add the google-play-services_lib to my project, apperently eclipse is to stupid to find the path.
When i click properties > android > add project > google-play-services_lib it adds the library in the list, gives me also a green sign, everthing well.
Then i click apply, and nothing happens, nothing added to depedencies...
When i check properties > android again it tells me it didn't find the path i gave...
Though i did multiple times exactly the same with other projects, and i just could add this library!...
Whats wrong..
Ive a second library which is the facebook_sdk, but this can't be the problem right?
Please help.
Is the Google Play Services library on a different drive to the project? There is an issue if they are located on different drives which causes eclipse to not find the path.
Copy the Google Play Services library to the same drive, and reimport into eclipse and see if that works.
Otherwise try deleting the play services project in eclipse and reimporting it. Sometimes if the SDK (and play services) has been updated, eclipse needs it to be reimported.
I was able to import both ActionBarSherlock and HoloEverywhere into Android Studio but I cannot get my app to compile.
screenshot:
https://docs.google.com/file/d/0BwOn70drOiMfZHZVeXdEVzNXRXc/edit?usp=sharing
For whatever reason my intent's seem to be freaking out and even though the library imports seem to be working fine, I'm also getting the following errors trying to emulate my application:
java: /Users/patdugan/usmc-pro-fitness-abs-he/src/com/patdugan/usmcprofitness/USMCProFitMainActivity.java:16: package org.holoeverywhere.widget does not exist
Anybody have any thoughts?
I just had this issue.
What you need to do is go to File > Project Structure... and click on Modules. Make sure that ActionBarSherlock has the support library under its Dependencies tab. If not, click the plus at the bottom and add a Library (You may have to click New Library... to select the libs folder within the sub-project).
After this is done, change the scope to Provided so that you don't get lib conflicts when compiling your app.
Holoeverywhere doesn't use ActionBarSherlock anymore, it now relies on the ActionBarCompat library.
I've tried everything i can think of and i still can't get the R.java file to show up.
It's supposed to be in the "gen" folder in eclipse when i create a new project i believe.
I tried the following:
I went to Project > Clean...
I heard that there might be issues in the xml files, i couldn't find any errors there.
I tried using both android 2.1 and 2.2(my goal is to program in 2.2 but i tried both anyway).
Please help. I've seen a few other questions regarding the same issue on here; i've tried using the suggestions found in the answers to those questions but unfortunately, no luck.
Progress: 1
SOLVED: I found out i was missing Android SDK Platform Tools. If you're having the same problem, make sure you have it installed.
Go to Window > Android Sdk and Avd Manager > Available Packages > Android Repository > Android SDK Platform Tools(the latest version) > Install. Sorry for causing any confusions. I will one-up those who put some effort into helping me. Thank you very much for your efforts. :)
Try a right-click on the project and select "Refresh". This usually does the trick for me when "Clean" does not.
you shall find the answer here..tat works for me. just try...
R file is missing android
I have faced the same problem many times untill and unless u wont remove errors from ur
xml file or any java file.
Then clean uo ur project....
Cleaning of project wont work in case there is errors,plz check for the same
if above option not working then try project->built automatically checked then clean project then try to run it