Problems importing project into Android Studio regarding ActionBarSherlock
Seems there's a lot of general issues on importing modules to Android Studio
, not just ActionBarSherlock
, this answer might also address those. (However the last steps relating to junit are particular to abs
)
The steps below allowed me to get ActionBarSherlock
running with no issues.
1) Download latest ABS here: http://actionbarsherlock.com/
2) Extract ABS you should have a directory in there called "actionbarsherlock". Copy that to your Android Studio workspace. and rename to ActionBarSherlock (changed casing)
-- > I now have my Android Studio Projects under \*documents*\Android Workspace\
As opposed to \Eclipse Workspace\
So you should now have something like :
\*documents*\Android Workspace\ActionBarSherlock\
Along with your main project maybe:
\*documents*\Android Workspace\TestProject\
3) Open Android Studio load your TestProject
then goto File> Import Module..
. Now navigate to ActionBarSherlock under \*documents*\Android Workspace\ActionBarSherlock\
Click Ok and next all the way to finish. It will ask if you want to set a dependancy to the new Module (or at least mine did) click OK
4) at this point when compiling I was getting errors in \ActionBarSherlock\test\
complaining about Junit
. I simply deleted the \Test\
directory from my ABS Module under project view. Right click \test\ > Delete...
. You could also include the junit jar file but I don't think its necessary
5) you should now be able to compile without errors
Hopefully that helps someone.
Essentially though, I needed to re-download a completely fresh ABS, expunge my old project's ABS (which was probably quite old) then Import Module...
Android Studio project can't resolve ActionBarSherlock imports
First sync your project with gradle and check if it gives some error, if it worked fine go back and try importing something from actionbarsherlock library in any of your class.
If above step doesn't help. Check once Your_Project/your_module/build/exploded-bundles/ComActionbarsherlock.../classes.jar exists or not.
Then go for this :
Clean your project from Build > Clean Project
, sync your project with gradle than check this for reference.
Import Google Play Services library in Android Studio
Or Follow the steps :
- Exit Android Studio
- Delete all the .iml files and files inside .idea folder from your project
- Relaunch Android Studio and wait till the project synced completely with gradle
This is bug in Android Studio 0.4.2 and fixed for Android Studio 0.4.3 release.
How to import Action Bar Sherlock? android studio
Change the android:targetSdkVersion="23"
to targetSdkVersion 23
It will work.
For more info go through developer site : Android Build Configuring
Also use the latest support library
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
compile 'com.android.support:support-v4:23.1.0'
Error after adding dependencies to Action Bar Sherlock in Android Studio 0.5.8
Your project depends on both appcompat-v7
and ActionBarSherlock
. They both provide the same functionality and define the same style attributes - which are conflicting.
Either remove ActionBarShelock
or appcompat-v7
library.
I recommend using ActionBar
from appcompat-v7
rather than ActionBarSherlock
.
Support library features. AppCompat
Adding the Action Bar
import .R cannot be resolved when I import actionbarsherlock
edited the build path of my android project to include the library
Never manually modify the build path of an Android project.
ActionBarSherlock is an Android library project. You need to add a reference to ActionBarSherlock's library project from your main application project and undo the manual change to the build path.
UPDATE
The second half of your problem was that your build target was set too low. The build target controls what version of the Android classes, resources, etc. is available to your app, and if you use ActionBarSherlock, you need this to be API Level 14 or higher.
if I make my project build target 4.0, can I still run it on an emulator/phone running Android 2.3?
Yes. Set your android:minSdkVersion
to be 10 or lower. Eclipse (via Lint) will yell at you if you accidentally try using classes, methods, and such that are higher than your minSdkVersion
, even though they are legal due to your build target.
Importing android project as library project in another android project
You can't use together ActionbarSherlock and Appcompat library.
They use the same attributes.
Since the Actionbarsherlock library was deprecated by the author 2 years ago, there is no need to use this library today.
Use the the AppCompat library
Related Topics
Automatically Log Android Lifecycle Events Using Activitylifecyclecallbacks
Deadobjectexception on Android App
What Is the Equivalent to a JavaScript Setinterval/Settimeout in Android/Java
Android Color Notification Icon
Intellij Build Error Context Mismatch
Read/Write .Txt File with Special Characters
Java to Ruby Aes/Ecb/Pkcs5Padding Encryption
Spring Boot - Handle to Hibernate Sessionfactory
How to Increase the Number of Displayed Lines of a Java Stack Trace Dump
How to Remove a Specific Element from a JSONarray
Transparent Blurry View Which Blurs Layout Underneath
Internet Listener Android Example
Multiple Dex Files Define <My Package>/Buildconfig, Can't Find the Cause:
Trivial: Get Confirmation of Email Sent in Android
How to Get Java Output with Ruby
Spark: How to Map Python with Scala or Java User Defined Functions