Some jar(v4 support, ActionBarSherlock and etc.) import error in Android Studio
来源:互联网 发布:网络推广需要多少钱 编辑:程序博客网 时间:2024/04/30 03:51
How to configure ActionBarSherlock with Intellij IDEA
[Original URL:http://android-wtf.com/2012/09/how-to-configure-actionbarsherlock-with-intellij-idea/]11 RepliesIntroduction
This tutorial will guide you through the steps to set up ActionBarSherlock (ABS from now on) with your Android project created using Intellij IDEA. Just for the record, I’m using ABS version 4.1.0 and IDEA version 11.1.3.
Requirements
- You must target API level 14 (Android 4.0) or higher
- You must install the Android Support Library using SDK Manager, since ABS depends on it
As a rule, you should always target the latest API version to avoid enabling unnecessary compatibility behaviors, to take advantage of the latest platform improvements and optimizations. ABS, in turn, will use the platform’s native ActionBar
implementation instead of it’s own backport. As far as ABS is concerned, minimum SDK version can be as low as 7 (Android 2.1).
Step 1: Download ActionBarSherlock
Download and extract ActionBarSherlock, preferably to the same directory where your projects reside. By default, it is C:\Users\<Name>\IdeaProjects
on Windows 7.
If you prefer Git, clone and checkout the latest stable version.
Step 2: Create a module with Intellij IDEA
- Switch to IDEA
- Open
File > Project Structure
- Select
Modules
on the left pane - Click on the plus sign above the second column, and choose
Module
Add Module
window will appear. Select the Create module from existing sources
option- Click on the button right next to the textbox
- A tree-based directory chooser dialog will pop up. Within the dialog navigate to the ABS directory, and choose the
library
subdirectory - Click
OK
to dismiss the dialog - Back in the
Add Module
window, click Next
as many times as needed - Click
Finish
- Select your application module in the
Modules
pane - Activate the
Dependencies
tab, then click on the plus sign on the right, and select Module dependency...
- Select the ABS library and click
OK
- Finally click
OK
to close the Project Structure
window
Step 3: Add Android Support Library
- Copy the jar file
<sdk>\extras\android\support\v4\android-support-v4.jar
to your project’s libs
directory (create one if it doesn’t exist) - Switch to IDEA
- Open
File > Project Structure
if you have closed it - Select
Libraries
from the left pane - Click on the plus sign above the second column, and choose
Java
- From the file-chooser popup, navigate to your project’s
libs
directory - Choose the jar you copied earlier, and click
OK
- A popup titled
Choose Modules
will appear - Select both modules, and click
OK
- Click
OK
to apply the changes in the Project Structure
window
Conclusion
That’s it. You should now be able to use ActionBarSherlock in your project. Just don’t forget to extend the SherlockActivity
class instead of the native Activity
class. If anything goes wrong, let me know in the comments.
Introduction
This tutorial will guide you through the steps to set up ActionBarSherlock (ABS from now on) with your Android project created using Intellij IDEA. Just for the record, I’m using ABS version 4.1.0 and IDEA version 11.1.3.
Requirements
- You must target API level 14 (Android 4.0) or higher
- You must install the Android Support Library using SDK Manager, since ABS depends on it
As a rule, you should always target the latest API version to avoid enabling unnecessary compatibility behaviors, to take advantage of the latest platform improvements and optimizations. ABS, in turn, will use the platform’s native ActionBar
implementation instead of it’s own backport. As far as ABS is concerned, minimum SDK version can be as low as 7 (Android 2.1).
Step 1: Download ActionBarSherlock
Download and extract ActionBarSherlock, preferably to the same directory where your projects reside. By default, it is C:\Users\<Name>\IdeaProjects
on Windows 7.
If you prefer Git, clone and checkout the latest stable version.
Step 2: Create a module with Intellij IDEA
- Switch to IDEA
- Open
File > Project Structure
- Select
Modules
on the left pane - Click on the plus sign above the second column, and choose
Module
Add Module
window will appear. Select theCreate module from existing sources
option- Click on the button right next to the textbox
- A tree-based directory chooser dialog will pop up. Within the dialog navigate to the ABS directory, and choose the
library
subdirectory - Click
OK
to dismiss the dialog - Back in the
Add Module
window, clickNext
as many times as needed - Click
Finish
- Select your application module in the
Modules
pane - Activate the
Dependencies
tab, then click on the plus sign on the right, and selectModule dependency...
- Select the ABS library and click
OK
- Finally click
OK
to close theProject Structure
window
Step 3: Add Android Support Library
- Copy the jar file
<sdk>\extras\android\support\v4\android-support-v4.jar
to your project’slibs
directory (create one if it doesn’t exist) - Switch to IDEA
- Open
File > Project Structure
if you have closed it - Select
Libraries
from the left pane - Click on the plus sign above the second column, and choose
Java
- From the file-chooser popup, navigate to your project’s
libs
directory - Choose the jar you copied earlier, and click
OK
- A popup titled
Choose Modules
will appear - Select both modules, and click
OK
- Click
OK
to apply the changes in theProject Structure
window
Conclusion
That’s it. You should now be able to use ActionBarSherlock in your project. Just don’t forget to extend the SherlockActivity
class instead of the native Activity
class. If anything goes wrong, let me know in the comments.
- Some jar(v4 support, ActionBarSherlock and etc.) import error in Android Studio
- 关于 android-support-v4.jar
- 增加android-support-v4.jar
- Support13Demos 导入android-support-v4.jar android-support-v13.jar
- 找不到android-support-v4.jar、android-support-v7.jar怎么办?
- Error:Conflict with dependency 'com.android.support:support-v4' in project ':app'...解决方案
- Android:混淆排除android-support-v4.jar
- android源码查看 android-support-v4.jar
- android源码查看 android-support-v4.jar
- android源码查看 android-support-v4.jar
- android源码查看 android-support-v4.jar
- android源码查看 android-support-v4.jar
- android 关联 android-support-v4.jar 源码
- Android导入android-support-v4.jar
- android源码查看 android-support-v4.jar
- Error:Android Pre Dex: [android-support-v4.jar] at com.intellij.rt.execution.CommandLineWrapper.main
- 为android-support-v4.jar打包源码
- 为android-support-v4.jar打包源码
- 阿里巴巴2013实习生前端笔试题5月19号版
- linux串口通信参数宏详解实例
- 二分查找
- NSIS:.NET Runtime Library检测和本地安装
- Installing apache on RHEL
- Some jar(v4 support, ActionBarSherlock and etc.) import error in Android Studio
- N皇后问题
- 从zero起☞Python
- VS2010中的调试技巧
- 整数的二进制表示中1的个数(28)
- vs2010:fatal error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "StdAfx.h"”?
- C++空类有哪些成员函数
- sqlite的使用
- Set的使用