I updated My Android Support Library Version to 23.1.1?.. But Can't able to find and Import design Library?..
In order to use android design support library, try importing it from your SDK library.
It should be in your_SDK_path/extras/android/support in the folder you can find design, import it as a project in your eclipse and set is as is Library.
Just Refresh, Clean and Build.
You can find your library here inside your SDK
.../sdk/extras/android/support/design/libs
So, import from that, you will get your library.
Related
I was learning android notification tutorial using this link but when I started using
Notification notification = new NotificationCompat.Builder(this, App.CHANNEL_1_ID);
this code, I can't import android.support.v4.app. NotificationCompat , how to do that?
It only imports
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import android.app.Notification;
Do I need to add something in build.gradle?
I am using Android Studio 2021.1.1, is that the problem?
androidx is new support library for the replacement v4.support library. And androidx is recommended. I suggest you to use search filter to find tutorial later than 2020~2021.
However you can still use v4.support library by checking "Use legacy android.support library" option while creating a project.
While this is not enough, because latest build tools will not support deprecated libraries, you have to keep compleSdkVersion 28 or below. You are also required to downgrade your Android Gradle Plugin to 3.6.4 and gradle wrapper to 6.0
Make sure these lines are not present in gradle.properties
android.useAndroidX=true
android.enableJetifier=true
Now you can follow the above tutorial.
Use
android.arch.core:core
android.arch.core:common
instead of
androidx.arch.core:core-common
androidx.arch.core:core
Here is the full list of equivalent artifacts of support library to androidx
I do not recommend you to follow above tutorial find latest tutorial. Tech is rapidly changing, following an outdated tutorial might slow your learning process and keep you behind.
how to properly use the textinputlayout? what has been tried are as follows:
import the appcompat project import as library, import the support design jar
import the appcomtap project import as library, import the support design project import as library.
both produced the error No 'id' attribute supplied <public>, and no previous id defined in this file. this files are from support design -> res-public -> public_attr, public_string and public_styles.
if I did not included them, it says like missing backgroundTint.
the manifest file uses sdk min 11, target version is 22. the appcompat and support design is also 22 (tried 23 for all of them non worked).
also updated the support library to latest
what is the correct steps?
found the answer, just follow the steps provided by the answer marked as correct. steps to properly use android design support library
basically just import the app compat v7 targeting the latest api
then create an android project for design support and place all files of the design support library and then add the app compat v7 library to the newly created android project (design support)
you can then use this project marked as library to any project that needs this design support library (just make sure the app theme uses the Theme.AppCompat.Light.DarkActionBar at least to make it work)
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.
Even after clicking on Add Support Library and choosing version 19, eclipse still can't find android.support.v4.widget.SwipeRefreshLayout. Does anyone know how to get this to work? I am using
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="19" />
I am working on a mac mavericks computer with Juno.
update: import section
import java.util.Observer;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.TextView;
import android.support.v4.widget.SwipeRefreshLayout;//red underline
Update
By the way, I don't know if this matters: this is an Appengine Connected Android Project, which I build using Google-Eclipse-Plugin
Update 3:
It's looking like the Android Support Library 19.1.0 is not available through the SDK Manager. How else might I obtain it?
It was difficult to update the support library to version 19.1 so i downloaded it manually from https://dl-ssl.google.com/android/repository/support_r19.1.zip and added the jar to my build path manually. works for me. I dont know why the 19 update shows instead of 19.1.0
So it turns out the library is in the following location
/android-sdk-macosx/extras/android/m2repository/com/android/support/support-v4/19.1.0
As opposed to the usual
/android-sdk-macosx/extras/android/support
Also I had to restart eclipse and go to Android SDK Manager over and over and over, until the 19.1.0 version shows up.
I hope this saves someone else some trouble.
The SDK Manager update Android Support Library to 19.1.0.
But when you use Android Tools > Add Support Library, eclipse update Android Support Library to 19.0. I think this is a bug. Copy Android Support Library 19.1.0 to libs folder manually.
It looks as if you don't have the android-support-v4.jar in Java Build Path. Add it from the android-support-v7-appcompat.
For some reason, even though you may include v4 support library or you may have v7-appcompat included in your project, you may not be able to import SwipeRefreshLayout.
You need to make sure that
you change the target=android-19 to target=android-22(It should be anything greater that 19) and
manually import : import android.support.v4.widget.SwipeRefreshLayout; in your activity which will resolve the import related issue.
I had the same problem with old project. But when I create new project, Eclipse can find this import.
It's a problem with updating support library from eclipse: https://code.google.com/p/android/issues/detail?id=67991
Just update it by starting Android SDK manager manually and add new v4 lib to your project.
Thanks for tehnolog's tips.
Update to 19.1 by follow above link -> create new project and import android.support.v4 library -> simply copy android.support.v4.jar to old project's libs folder, Add To BuildPath. SwipeRefreshLayout will appear :D
In androidx, add
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
inorder to use SwipeRefreshLayout
I have recently updated a project that makes use of the Android Support Library ( android-support-v4.jar )
I updated the support library by "Android Tools > Add Support Library"
After doing this my project fails to build and the following imports that worked fine previously now error.
import android.support.v4.app.FragmentManager;
import android.support.v4.widget.SearchViewCompat;
import android.support.v4.widget.SearchViewCompat.OnQueryTextListenerCompat;
With errors long the lines of "The import android.support.v4.widget cannot be resolved"
What have I done wrong? how do I get it working again?
Which API are you using? It is best to use the Android SDK Manager in Eclipse(ADT) plugin to download the support libraries.
The Android Support v4 JAR needs to be in the 'libs' folder of your project. Make sure you have the JAR 'copied' in the folder. It is best to manually do it yourself to make sure it is there.
The best way to fix the 'red' import errors in Eclipse is
Ctrl + Shift + O
to automatically import the correct imports.
Please let me know if this helps! I have had problems with Android imports as well.
Regards,
The jar file also needs to be in your build path.