How do I add a library (android-support-v7-appcompat) in IntelliJ IDEA
Without Gradle (Click here for the Gradle solution)
Create a support library project.
Import your library project to Intellij from Eclipse project (this step only applies if you created your library in Eclipse).
Right click on module and choose Open Module Settings.
Setup libraries of v7 jar file
Setup library module of v7
Setup app module dependency of v7 library module
how to use android.support.v7 in intellij idea
You can just refer this post.
How to add android.support.v7.widget.GridLayout into intelliJidea?
And after this I also facing the problem of compile error, after some study finally find the root cause is the Project SDK setting, in my setting I set to 4.4.2, but the version21 is not recongized by 4.4.2. After I set to 6.0 everything is fine.
Add Android Support Library to get access to AppCompatActivity
use this on your app gradle file
compile 'com.android.support:appcompat-v7:25.1.0'
How to add android.support.v7.widget.GridLayout into intelliJidea?
It's late for an answer but here it is, at least for future people looking for a solution on how to add the support library and resources for GridLayout
(or ActionBarActivity
/ AppCompat
, see below).
The easiest way is as follows.
Make sure you have installed the Android Support Library, from the Android SDK Manager.
In IDEA: Open your project, then select
File
/Import Module
- select the directory under the SDK:
{SDK}\extras\android\support\v7\gridlayout
- select
Import module from external model
andEclipse
- you can then select
Create module files near .classpath files
, or choose to put them elsewhere if you can't / don't want to write into your SDK path - in the next screen you should see
Select Eclipse projects to import
andandroid-support-v7-gridlayout
, IDEA will also ask you to reload the project. - this should add a module
gridlayout [android-support-v7-gridlayout]
in your project.
- select the directory under the SDK:
Now you have to update your project dependencies to this module for the resources, and add the .jar libraries. Select
File
/Project Structure
- select the
Modules
project settings, and select your project (in the picture below, testv7) - select the
Dependencies
on the right panel - add with the
+
button (on the right panel) aModule dependency...
to theandroid-support-v7-gridlayout
- similarly, add a
Jars or directories...
pointing to the{SDK}\extras\android\support\v7\gridlayout\libs
directory (or to the .jar within). If you intend to use the v4 as well, choose{SDK}\extras\android\support\v7\appcompat\libs
instead since it contains both v4 and v7 jars - your settings should look like this:
- select the
And now you should be fine.
For me it was the only way out of the similar problem with the ActionBarActivity
, which is solved using the same technique on the {SDK}\extras\android\support\v7\appcompat
module. And I did try a few other ways ;)
can not connect android-support-v7-appcompat to my project
In your project, change Android Build Target to 5.0
To support values-v21, Your Build Target should be 5.0
Go to File -> "Project Structure"
Under Platform Settings -> SDKs
you can see android sdk path, classpath and build target.
Update your sdk first with latest build target using sdk manager.
If you're sdk is not up-to date then in the classpath you can see android version below 21.
If you have latest one, then You can see, classpath selected to \android-21\android.jar.
or
In you're Module Settings you can see "Build Tool Version".
Android Studio (IntelliJ IDEA) will be taking latest build version. So first update you're sdk manager to latest version.
Android support Library v7 appcompat
add this in your build.gradle(Module:app) dependencies:
compile 'com.android.support:appcompat-v7:21.0.3'
and then sync your project
it will add the library automatically
What is com.android.support:appcompat-v7:20.+ or com.android.support:leanback-v17:+? What's the relationship and difference between them?
They are both Android Support APIs from Google.
Android App Compat API:
v7 appcompat library
This library adds support for the Action Bar user interface design
pattern. This library includes support for material design user
interface implementations.
https://developer.android.com/tools/support-library/features.html#v7
Android Lean Back API:
The android.support.v17.leanback package provides APIs to support
building user interfaces on TV devices. It provides a number of
important widgets for TV apps. Some of the notable classes include:
https://developer.android.com/training/tv/start/layouts.html
https://developer.android.com/tools/support-library/features.html#v17-leanback
Related Topics
Unresolved Reference - Activity Does Not Recognize Synthetic Imports in Android Studio V4
Read the Package Name of an Android APK
Android Animation Is Not Finished in Onanimationend
Admob Error in Eclipse for Android:Configchanges
Android - File Provider - Permission Denial
How to Programmatically Add Buttons into Layout One by One in Several Lines
Java.Lang.Noclassdeffounderror: Javax.Activation.Datahandler in Android
Listing All Extras of an Intent
Android - How to Download a File from a Webserver
How Do Detect Android Tablets in General. Useragent
How to Use Both Ontouch and Onclick for an Imagebutton
Failed to Find Style 'Coordinatorlayoutstyle' in Current Theme
Connecting Mongodb from Mobile or Browser Based Application
How to Simulate :Active CSS Pseudo Class in Android on Non-Link Elements
How to Download the Android Sdk Without Downloading Android Studio