Some jar (V4 support, actionbarsherlock and etc.) import error in Android Studio

Source: Internet
Author: User
How to configure actionbarsherlock with intellij idea [original URL: http://android-wtf.com/2012/09/how-to-configure-actionbarsherlock-with-intellij-idea/11211
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 shoshould 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 nativeActionBarImplementation
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 isC:\Users\<Name>\IdeaProjectsOn
Windows 7.

If you prefer git, clone and checkout the latest stable version.

Step 2: Create a module with intellij idea
  1. Switch to idea
  2. OpenFile > Project Structure
  3. SelectModulesOn the left pane
  4. Click on the plus sign above the second column, and chooseModule
  5. Add ModuleWindow will appear. Select Create
    module from existing sources
    Option
  6. Click on the button right next to the textbox
  7. A tree-based directory chooser dialog will pop up. Within the dialog navigate to the ABS directory, and chooselibrarySubdirectory
  8. ClickOKTo dismiss the Dialog
  9. Back inAdd ModuleWindow, clickNextAs
    Faster times as needed
  10. ClickFinish
  11. Select your application module inModulesPane
  12. ActivateDependenciesTab, then click on the plus sign on the right, and selectModule
    dependency...
  13. Select the ABS library and clickOK
  14. Finally clickOKTo closeProject
    Structure
    Window
Step 3: Add Android support library
  1. Copy the JAR File<sdk>\extras\android\support\v4\android-support-v4.jarTo your
    Project'slibsDirectory (create one if it doesn' t exist)
  2. Switch to idea
  3. OpenFile > Project StructureIf you have closed it
  4. SelectLibrariesFrom the left pane
  5. Click on the plus sign above the second column, and chooseJava
  6. From the file-chooser popup, navigate to your project'slibsDirectory
  7. Choose the jar you copied earlier, and clickOK
  8. A popup titledChoose ModulesWill appear
  9. Select both modules, and clickOK
  10. ClickOKTo apply the changes inProject
    Structure
    Window
Conclusion

That's it. You shoshould now be able to use actionbarsherlock in your project. Just don't forget to extendSherlockActivityClass
Instead of the nativeActivityClass. If anything goes wrong, let me know in
The comments.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.