I deleted appcompat_v7 from folder - android

I didn't know what appcompat_v7 was meant for til now. Unknowingly, I deleted it not just from the Package Explorer but also its physical file folder, now, my apps won't work because of this. I tried looking for it by Importing from the Library and even installed the Android Support Library from SDK Manager, and I still can't find it. How do I fix this?

If you are using android studio, follow these steps
1. Remove it from build.gradle dependency list( compile 'com.android.support:appcompat-v7:+') and restart android studio.
2. Now add the appcompat library back again, and click on sync at top right of build.gradle. It will download and install again.

Related

eclipse mainActivity.java and others lots of error on start

I am getting trouble with my eclipse.
I'm not yet starting to code. just started making a android app project and errors
are showing already.
problem tab
DZOGRAFI : i've tried what you answered , this is the result. T_T
[edit]
By having a look at the problem tab and the project explorer window I am guessing there is something wrong with the appcompat_v7 library. It cannot be built for some reason.
So, first of all make sure that you actually want to use the v7 support library (Eclipse automatically imports the library when you start a new project using some features). I can see inside your MainActivity.java file that you are extending MainActivity from ActionBarActivity (which automatically imports android.support.v7.app.ActionBarActivity into your project). Extend from Activity instead if you don't actually need the ActionBarActivity class.
If you actually need the support library, keep one copy of it into your workspace (Delete the others) and check if it is updated to the latest version. Inside Eclipse go to Window->Android SDK Manager and scroll down to the extras folder. Check for newer versions of the Android Support Library.
Additionally make sure you have downloaded the SDK platform for the latest APIs and the latest android SDK-Build Tools.
[edit]
Try removing the project (Right click ->Delete) and importing it again. Go to
File->Import then select Android->Existing Android Code into Workspace and click Next. In the window that appears click Browse and go to your Android SDK Folder and look for [Android SDK Folder]\extras\android\support\v7\appcompat. The project should be checked for import and then click "Finish". Clean the appcompat project and then the one you are working on. Please make sure that you are building the appcompat project using the latest API Level (Inside the appcompat Properties->Android check the Android 6.0 Build Target)
Also make sure that in your project's properties you have set the appcompat project as a Library for your project.
After you have done those. Clean and Build the entire workspace and restart Eclipse.
Hope this solves your problems

Exporting an eclipse project as gradle

I have been trying to export my eclipse project as a gradle build file to use it with Android Studio but I can't seem to make it work correctly.
When I click "Finish" nothing happens. If I repeatedly click it, I can see a progress bar that shows for a millisecond and then vanishes.
My ADT is version 22.3 (which is the latest) and I have tried all of the solutions I found on google as well.
Similar questions can be found here:
Eclipse Gradle export of Android project does nothing
Cannot generate gradle.build files from Eclipse
As you can see, there is not really a solid solution for this problem, but people wrote they created it manually. I don't know how to do so though.
Is there any solution for this problem that I haven't heard of? If not, how can I create the file manually?
Apparently, the current edition of the export-to-Gradle support in Eclipse cannot handle a project that is attached to an Android library project. In that case, you would need to (temporarily) detach the Android library project, export the main project, then modify build.gradle to use the library project (manually or via Android Studio).
Generating build.gradle files FIRST FOR ALL of the projects in my dependencies ONE AFTER ANOTHER worked for me.
I generated build.gradle (with export wizrd for facebook, play and whatever other projects I imported and used in my project).
For not trivial Android project you should do it manually.
For the latest build.gradle template for classic Android project check gh.c/N/n-1/b/m/o.n.e.e.g/docs/android/build.gradle.
You can continue to develop in Eclipse with ADT and run Gradle build using Nodeclipse/Enide Gradle for Eclipse
(marketplace)
Some screenshots for Gradle for Eclipse:

Updating to Android SDK Tools R22

I updated the SDK Tools to R22 and the ADT Plugin as well. Everything worked well before the update but since then, I have problems.
Basically I have 2 library projects and an app project. One of my library projects contains some jar files in the "libs" folder. One of these jars is used in the app project itself for some initial setup. Before the update, everything worked fine, but now it asks me to add the jar to the build path and even if I do so, when running the app it still gives me ClassNotFoundException.
Did anyone had some similar experience or has any idea about what causes this and how can it be fixed?
Thanks.
Check this Android Sdk tools Revision 22 issue?. "I found that I needed to check all of the boxes in the order/export tab of the Java Build Path for the project - and each library -- to properly compile and run the app on a device." - should helps.
The workaround here worked for me
OK. I also had a Simillar kind of Problem.
Like say If you have library project as google-play-services_lib before updating than might happen that your library code has been also updated after updating your SDK.
You Should Remove that library project from your Workspace and Import
again from the source
folder like in my case i had to import from /android-sdk-linux/extras/google/google_play_services/libproject/google-play-services_lib. Add reference of
your library path to you android app project. clean and build your Project.
Hope this Helps.
you should try to upgrade eclipse.
1) Get the new imports via the Android SDK Manager
2) Check for updates in the Eclipse repository: help/check for updates
That would "for real" upgrade the SDK version in your configs.
Dunno if the other steps pointed by VShcryabets are needed, i had them before.

Android Dependencies references non existing library google-play-services_lib.jar

I've been having a terrible time trying to get a simple Map to appear in an app as shown on the Google Maps v2 documentation. Eclipse keeps saying:
The container 'Android Dependencies' references non existing library 'X:\Android Development\workspace\google-play-services_lib\bin\google-play-services_lib.jar'
I found a couple people on here that had the problem and I followed those steps with no luck. I have Google Play Services installed and I even uninstalled and reinstalled it. I have imported google-play-services_lib project into Eclipse and checked move to workspace.
Any help would be amazing as I cannot get this to work. I did check in the location and there isn't a file there, so I don't know why it is missing since I have installed Google Play Services.
This answer worked for me https://stackoverflow.com/a/16398399/1874332
I met this issue as well.
My solution is,
clean project google-play-services_lib firstly then clean my project
which depends on play service library
I fixed this issue by:
Right click "google-play-services_lib" project, select "Properties".
Click "Android" on left panel.
Check a version of Android SDK on "Project Build Target", then select "OK" button.
Rebuild google-play_services_lib project, now you have "google-play-services_lib.jar" in "bin" folder.
Clean and rebuild your project.
Details: google-play-services_lib project's original build target is android-10. If you do not install this version of Android SDK in Eclipse, Eclipse just don't build it, leaving an empty bin folder. And our project reference to a .jar file in this bin folder, which results in the error message. So to fix this issue is just to check an appropriate build target for google-play-services_lib project.
In Eclipse open Project -> Properties.
Select Android on left.
Check on the bottom that you have a reference to Google play services with a green checkmark. If not, click Add and add the google play services library
I fonund my answer. I hope this helps someone.
I've installed several versions of Android Build Tools. (17, 18, 18.1, 19).
I read other questions and answers. Someone pointed Build Tools.
So, I went to the SDK manager and I removed all Build Tools but not latest. (19)
Clean google-play-servies. And re-build.
Clean my project. And re-build.
Voila~! Thanks all~! I'm very happy!!
I've tried everything but nothing works for me even Google sample projects, at last I've updated all the packages in sdk and eclipse ADT plugin to ADT 14, then it works fine :-)
I solved this by right clicking the google-play-services_lib and building the project.
I 'deleted' it from the workspace and then re-added it, to make sure when I wasn't altering settings / hadn't changed anything important. This built successfully.
I then built my main application and it worked successfully.
I was getting strange path errors and android-9 resolution errors. But it seems to be working now.
My solution is,
clean project google-play-services_lib firstly
then clean my project which depends on play service library
I simply re-imported google play services library project and it worked!
I had the same problem. In order to fix this, you must ensure that your project supports same version of android sdk that is specified in the google-play-services-lib.
So, in my case, I have project that has Minimum Required SDK set to API15. So, once you have imported google-play-services-lib into your project following these steps here https://developer.android.com/tools/projects/projects-eclipse.html#ReferencingLibraryProject, make sure you open you see the google-play-services-lib in your Package Explorer in Eclipse. Expand it, right-click on it and select Properties. In the Project Build Target, make sure you check an SDK that is at least equal to Minimum Required SDK set in your project, in my case API15:
I was facing the same issue and got it solved when I updated my eclipse Android SDK tools.
I was using version 22 and when I updated Android SDK tools to 22.0.1 the error vanished and I could build my project.
I hope this helps someone...
First of all right click on the Project and import google-play-services if exist otherwise follow the steps told by #yoah (import it under sdk->extra->google->google-play-service-libproject->google-play-services_lib) and if still the problem doesn't solve then there may be multiple problems with multiple solution..
Solutions.
Restart eclipse
Clean the Project
upgrade google-play-services
Installing the new Build Tools did the trick. They were not
automatically included when I updated the SDK
If you have import the code . Be quiet sure to copy it to work space
otherwise this error may occur.
In Eclipse. Right click on your project -> "Android Tools" -> "Fix Project Properties"

Android showing "Unable to get system library for project"

I was working on an android tutorial and it wanted me to import the library from another project. All well and good. The import worked and the project works correctly. But I noticed that doing that messed up several of my other projects (the ones that use Android 2.2) by apparently messing with the build path. Now instead of seeing "Google APIs [Android 2.2]" under the gen folder I see "Unable to get system library for project". When I right-click the project and go to Properties I see that the correct Project Build Target is checked(Google APIs [Android 2.2]), but "Unable to get system library for project" is still shown above the assets folder and below gen and Android Dependencies. Cleaning all projects doesn't help. How can I fix this problem, and is there a way to fix this issue globally or do I have to do it one by one?
In the project root folder you should have file named project.properties
---- file content -----
target=android-16 ## <--- make sure that it is there and that you have proper sdk installed
For me, the problem was that in the Project settings - Android tab, I had no Android version selected.
For me I had SDK version 8 selcted, but if I selected the next highest version, applied, then selected version 8 again and apply, fixed the problem.
For me, what worked was to restart Eclipse. Hope this helps.

Categories

Resources