Android Support Library v7 missing appcompat - android

So when I import the Android Support Library v7 (appcompat JAR), I see that I get a noclassdeferror when trying to use it. This is because the package android.support.v7.appcompat is not being found as it is not even there in appCompat.JAR. I confirmed this by extracting the contents of the JAR file. I tried reinstalling the JAR with SDK Manager, however I am missing the same package every time. Can someone tell me what's going wrong?
Thanks

You have to import the appcompat library in to your project...please check the following link for getting how to setup appcompat in your project..
https://developer.android.com/tools/support-library/setup.html
thank you

Also had this problem. Yes, I knew I need to use the SDK Manager dialog to download the support library from the extras folder, as per the Support Library Set-up link, but it wasn't listed there - there is only the "support repository".
The problem is that it is hidden by default, as it has been deprecated. You need to check the "show: obsolete" checkbox. And then it's available to download.

You need to import support
dependencies {
...
implementation "com.android.support:support-core-utils:28.0.0"
}

Related

The import com.google.android.gms.ads cannot be resolved

I am getting error when i want to import google-play-service in Eclipse.
i have import google-play-service-project-lib in Eclipse
i have read all possible Q&A but nothing is work.
I have it added as Library and JAR manually
Then I have tried to clean my project ...
Is there anybody who can solve this problem?
You can use this way. First of all close projects which are using google-play-services library. Whenever your mouse over the com.google.android.gms import that can not be resolved and towards the bottom of the popup menu, select the "Fix project setup" option as below. Then it'll prompt to import the google-play-services library.
Firstly, try to download latest version of Google Play Services, then:
Remove the existing library to add again manually,
Go to your java build path,
Under project tab add your library and then,
Under order & export tab tick your library,
Apply settings.
After all, just clean the project and library, it should work.
By the way, you can also check this question.
To me it was just a matter of updating the dependencies.
dependencies {
implementation 'com.google.android.gms:play-services-ads:20.6.0'
}
I concluded that if it's already on the latest version, refresh the Gradle may solve the issue - or, as already recommended by Umit Kaya, remove the existing library and add it back.

Android support library v7

I am making an android app that contains action bar and fragment which are not supported for API level 8!
So I just tried to import support library V7 to fix this problem!
But when I try to do it , it doesn't find support library for V7 , there is support.v4 but not v7.
what should I do to fix it?
Should I download anything for my android SDK?
Download Android Support Library in Your SDK manager under Extras. Then Import appcompat from following folder in your sdk.
Android-SDK\extras\android\support\v7\appcompat
The first step is to download the library through the SDK manager.
Support library v7 is a library project, so needs to be added as a new project to your workspace.
Note: You can't just drop the .jar in because it has additional XML resources.
There's some pretty thorough instructions on how to add it located here.

Android The import com.google cannot be resolved

I'm trying to test LocationService example of Android developer as per following link http://developer.android.com/training/location/retrieve-current.html. At that time, error message show me that "The import com.google cannot be resolved" for following 5 lines. I'm really confused how to solve this problem.
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesClient;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.location.LocationClient;
import com.google.android.gms.location.LocationListener;
import com.google.android.gms.location.LocationRequest;
You will need the Google Play Services SDK configured within Eclipse and import google play services as library will dismiss this error .
There is a much simpler solution. In my case, I've gone through all the answers from a few sources and none of them give a straight answer to my problem. Finally, I found a sample app source code and when I import the source code I found out adding the library from Google Play Service Library directory solved it. Google Play Service Library is located (for windows user) here:
\sdk\extras\google\google_play_services\libproject
Import the library into Eclipse as a library project and add this library in your actual project will fix it.
EDIT: This guy made a great contribution on his tutorials how to use Android Google Map v2 step by step and very details. It also includes how to use with Android Support package’s backport of fragments.
http://ddewaele.github.io/GoogleMapsV2WithActionBarSherlock/part1
Assuming you use Eclipse.
Right-click on your project -> properties -> Android.
There use Google API's instead of standard Android.
If you're using Android Studio:
Right click on your app folder -> Open Module Settings -> Dependencies -> Click on the plus button -> Choose library dependency -> Search for "play-services" -> Double click on the com.google.android.gms:play-services
Press Ok and wait for Gradle to rebuild.
You can use this way. First of all close projects which are using google-play-services library. Whenever your mouse over the com.google.android.gms import that can not be resolved and towards the bottom of the popup menu, select the "Fix project setup" option as below. Then it'll prompt to import the google-play-services library.
If you're using Eclipse, you can fix this by installing Google Play Services SDK via the SDK Manager, load the google-play-services-lib project into Eclipse, and set this as a reference from your project. This is documented at http://developer.android.com/google/play-services/setup.html
Do you use android sdk with google api? If not, do that and it will work.
set your project properties to google api.
You will need the Google Play Services SDK configured within Eclipse.
Maybe useful for some other developers facing this error:
If you are changing to a newer Android Version and if you are using the android-support-library, you have to beware that all projects that you use as library also have the SAME version of the android-support-library. One example would be the actionbar-sherlock. ;)
It Works = Do you use android sdk with google api? If not, do that and it will work.
In project.properties I had to add the following (for ANT build):
android.library.reference.1=${root_prefix}/${sdk.dir}/extras/google/google_play_services/libproject/google-play-services_lib
If you are using Android studio you may be missing to add gradle to your project.
Add specific play service you want.
Here you may want to compile
com.google.android.gms:play-services-location:10.2.1
Add this to your build.gradle app module in dependencies.
In android studio,add dependency as follows:
In gradle script,go in build.gradle(Module:app) and add these lines
compile 'com.google.android.gms:play-services:10.0.1' in dependencies tag
Here 10.0.1 may be skipped or changed according to your library installed

Problems using ViewPager Example

I'm an android newbie trying to use the ViewPager control which is part of the "Compatibility Package."
I first used the SDK manager to install the Extras Support Package.
I then went to https://github.com/commonsguy/cw-omnibus/tree/master/ViewPager/Fragments and got the ViewPager project and loaded it into Eclipse.
I then added a libs folder to the project and put "android-support-v4.jar" into that directory.
I did a Clean build and got all sorts of errors. The screenshot of my project is at http://dl.dropbox.com/u/39662979/viewpager.jpg.
What have I faild to do?
thanks,
Gary Blakely
I have seen that you are using part of SherlockActionBar but the missing themes had to be referred to a miss library. In particular you have to import as a library project the Jake Wharthon's work and then link to your project as android library.
Delete the Theme or add the theme to your styles.xml.
I do think you don't need the Theme if you only try to use ViewPager.
So delete it.
You might be looking for ActionBarSherlock - FAQs.
There is a video that will help You get started with the library
P.S. don't forget to delete import android.R; if You have it

Action Bar for android < 3.0

I want use ActionBar for my application but i found it can't use for android < 3.0.
I found this https://github.com/johannilsson/android-actionbar to solved my problem but I get error at
import com.markupartist.android.widget.ActionBar;
import com.markupartist.android.widget.ActionBar.Action;
import com.markupartist.android.widget.ActionBar.IntentAction;
Give ActionBarSherlock a try. I use it for one of my projects and after some reading of the docs and the samples it just worked. The samples are easy and straight forward, you should be able to extract what you need from them.
To see what it's able of just download the sample app from the market: Sample App (requires at least Android 1.6)
You should add the code to a library, and add the library to your project.
To do this in Eclipse create a new project, using the same package name as the github project (so com.markupartist.android.widget). In the properties select the project to be a library under the Java Build Path tab. Then, in your project, go to its properties, and select the library.
I think your including files are missing (JAR libs) , Click on error icon and then select fix project setup.
I spent around 10 hours trying to fix this problem. All the above ans does not work. Actually what is missing is android support library. To fix this, right click on project, >Android Tool> Add Support Library. Hope this save alot of time for other who came across this. just add support library both on your ActionBar library and the current project.

Categories

Resources