ActionBar Sherlock with Android Studio 0.2.2 - android

I am developing a demo app using ActionBar Sherlock and Android Studio.
Android Studio Version is 0.2.2, gradle version is 1.6 and plugin version is 0.5.1 and i am following these tutorials :-
www.grokkingandroid.com
showlabor.blogspot.ca
i am getting following error :-
Gradle: Execution failed for task ':libraries:ActionBarSherlock:actionbarsherlock:compileReleaseAidl'.tried to access class com.android.build.gradle.internal.tasks.DependencyBasedCompileTask$DepFileProcessor from class com.android.build.gradle.internal.tasks.DependencyBasedCompileTask
actionbarsherlock build.gradle file goes like this :-
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android-library'
dependencies {
compile 'com.android.support:support-v4:18.0.+'
}
android {
compileSdkVersion 17
buildToolsVersion '17.0.0'
defaultConfig {
minSdkVersion 7
targetSdkVersion 16
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
}
and my project build file goes like this :-
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
dependencies {
compile 'com.android.support:support-v4:13.0.+'
}
dependencies {
compile project(':libraries:ActionBarSherlock:actionbarsherlock')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 16
}
}
any leads on this is highly appreciated
Thanks :)

try
dependencies {
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
compile 'com.android.support:support-v4:13.0.+'
}

I had the same error until I used the same gradle file as the one from the sample for ABS and gradle here, that's a working sample project: https://github.com/JakeWharton/ActionBarSherlock-Gradle-Sample

Related

After add Fabric for crash report I can't add new libs in gradle

I'm just installed the library Fabric for Crash monitoring, but now, I'm trying to add a library to rate your app (compile 'com.androidsx:rate-me:4.0.0') but now gradle stops showing that it failed to resolve the library.
buildscript {
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'android'
apply plugin: 'io.fabric'
repositories {
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
compile('com.crashlytics.sdk.android:crashlytics:2.3.2#aar') {
transitive = true;
}
compile 'com.android.support:support-v4:22.1.1'
compile files('libs/library-1.0.6.jar')
compile files('libs/gcm.jar')
compile files('libs/acra-4.6.1.jar')
compile files('libs/acra-4.6.1-sources.jar')
compile files('libs/acra-4.6.1-javadoc.jar')
compile files('libs/TestFlightLib.jar')
compile files('libs/crouton-1.8.4.jar')
compile project(':LVL')
compile files('libs/bugsense-3.5.jar')
compile 'com.androidsx:rate-me:4.0.0'
}
android {
compileSdkVersion 21
buildToolsVersion '21.1.2'
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
}
The output:
What is the problem?
Solved:
jcenter() was missing inside repositories section.
Thanks.

Configuration default not found Android studio - Import from Eclipse

I have been using Eclipse and ADT for building my project. It has been working fine. Recently, I tried migrating my project to Android studio 0.3.7 and I am facing some issues.
My project has a src project, test project, and a library project that successfully get exported from Eclipse.
When I choose the Import Library option, I get the following error.
"Configuration name default not found".
This is my build.gradle for the top level project:
// Top-level build file where you can add configuration options common to all sub-
projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
And this is my settings.gradle,
include ':tests:MyProjectTest'
include ':mylibrary'
include ':
The only modification I have done after the eclipse export is to change the following file:
./gradle/wrapper/gradle-wrapper.properties
To change
distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
I changed the above line to use 1.8 instead of 1.6.
Any ideas?
You should do like this:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
dependencies {
compile files('libs/my_lib_jar.jar')
compile project(':mylibrary')
compile 'com.android.support:support-v4:18.0.+'
}
android {
compileSdkVersion 19
buildToolsVersion '19.0.0'
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
}
By the way, your tests must have path 'project_directory/tests/java/package_name/test'
You should have a structure like this:
Root
- MyProjectTest
build.gradle
src
res
- myLibrary
build.gradle
src
res
settings.gradle
build.gradle
In settings.gradle:
include ':MyProjectTest', ':myLibrary'
In myLibrary/build.gradle:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android-library'
android {
compileSdkVersion 19
buildToolsVersion "19.0.0"
defaultConfig {
minSdkVersion XX
targetSdkVersion 19
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
In Project/build.gradle:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
dependencies {
// Libraries
compile project(':myLibrary')
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.0"
defaultConfig {
minSdkVersion XX
targetSdkVersion 19
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
In your script you are using:
classpath 'com.android.tools.build:gradle:0.5.+'
Gradle 1.8 require 0.6.3 version.
You can use
classpath 'com.android.tools.build:gradle:0.6.+'

SlidingMenu ABS and Android Studio

I have read through a bunch of different Stack Overflow posts and various blogs all offering different ways to get these libraries working with android studio but I have yet to be successful with any of them.
I am currently using android studio 0.2.5.
The current error I am getting when trying to run gradlew assemble:
What went wrong:
Execution failed for task ':libraries:ActionBarSherlock:actionbarsherlock:compileReleaseAidl'.
tried to access class com.android.build.gradle.internal.tasks.DependencyBasedCompileTask$DepFileProcessor from class com.android.build.gradle.i
nternal.tasks.DependencyBasedCompileTask
My project structure is as follows:
|MyProject
----|MyProject
----|libraries
--------|ActionBarSherlock
------------|actionbarsherlock
----------------build.gradle
------------|actionbarsherlock-fest
------------|actionbarsherlock-i18n
------------|actionbarsherlock-samples
------------build.gradle
------------settings.gradle
--------|SlidingMenu
------------|library
----------------build.gradle
----|MyProject
----build.gradle
settings.gradle
All the build.gradle files are below:
MyProject - > MyProject -> build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 16
targetSdkVersion 16
}
}
dependencies {
compile 'com.android.support:support-v4:13.0.0'
compile files('libs/Parse-1.3.3/Parse-1.3.3.jar')
compile project(':libraries:ActionBarSherlock:actionbarsherlock')
compile project(':libraries:SlidingMenu:library')
}
MyProject - > libraries -> ActionBarSherlock -> build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
allprojects {
group = 'com.actionbarsherlock'
version = '4.4.0'
repositories {
mavenCentral()
}
tasks.withType(Compile) {
options.encoding = "UTF-8"
}
}
MyProject - > libraries -> ActionBarSherlock -> actionbarsherlock -> build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android-library'
dependencies {
compile 'com.android.support:support-v4:13.0.0'
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 16
targetSdkVersion 16
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
}
MyProject - > libraries -> ActionBarSherlock -> settings.gradle
include 'actionbarsherlock'
include 'actionbarsherlock-fest'
include 'actionbarsherlock-i18n'
MyProject - > libraries -> SlidingMenu -> library -> build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android-library'
repositories {
mavenCentral()
}
dependencies {
compile 'com.android.support:support-v4:13.0.0'
compile project(':libraries:ActionBarSherlock:actionbarsherlock')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 16
targetSdkVersion 16
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
}
MyProject - > settings.gradle
include ':MyProject', ':libraries:SlidingMenu:library', ':libraries:ActionBarSherlock:actionbarsherlock'
I think that's all the important files but please let me know if I missed one.
Thanks for any advice you can give!
Edit 1:
Made sure all the build.gradle files had:
compileSdkVersion 16
buildToolsVersion "18.0.1"
as some were different.
Made sure all manifests had:
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="16"/>
I also updated everything the sdk updater tool had to update but still no luck.
Did you add Dependency to your project in Project Structure

Gradle Error: Android Studio, ActionbarSherlock, and SlidingMenu

I've been at this for a couple of days trying to get the library structure correct within Android Studio. I would have just continued with Eclipse, but performance wise, it's been really bad for me lately. Please, any guidance would be greatly appreciated as all solutions found have not worked and the documentation has lead me nowhere.
All manifests have an empty application tag except for the main TestProject.
Edit* Prior to including SlidingMenu, I did have ActionBarSherlock working without issues and building, etc.
The Error
Gradle: Execution failed for task ':libraries:SlidingMenu:processReleaseManifest'.
> Manifest merging failed. See console for more info.
Build.Gradle (SlidingMenu)
apply plugin: 'android-library'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
dependencies {
compile 'com.android.support:support-v4:13.0.+'
compile project(':libraries:actionbarsherlock')
}
android {
compileSdkVersion 17
buildToolsVersion '17.0.0'
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aild.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
}
Build.Gradle (ActionBarSherlock)
apply plugin: 'android-library'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
dependencies {
compile 'com.android.support:support-v4:13.0.+'
}
android {
compileSdkVersion 17
buildToolsVersion '17.0.0'
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aild.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
}
Build.Gradle (Test Project)
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
dependencies {
compile 'com.android.support:support-v4:13.0.+'
compile project(':libraries:actionbarsherlock')
compile project(':libraries:SlidingMenu')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 16
}
}
settings.gradle (Test Project)
include ':TestProject',':libraries:actionbarsherlock',':libraries:SlidingMenu'
For me the problem was with 'missing <application/> tag' in slidingmenu library.
After adding empty <application/> tag to manifest errors disappeared.
Maybe this will help somebody.
See thread here: https://groups.google.com/forum/#!topic/adt-dev/PIah7eYXiNs
Unfortunately, this could be happening for a lot of reasons. I'd suggest running gradle build -info from the command line to see if it gives you more information.
A common merge failure I've run into is when the minSdkVersions are conflicting. I see that your test project minSdkVersion is 7, are the minimum levels declared in the ActionBarSherlock and SlidingMenu manifests 7 or less?
I already solve it. I share my configuration. Maybe this can help you.
Project:
+ TestProject
|-- libraries
|-- ActionBarSherlock
|-- actionbarsherlock
|-- actionbarsherlock-fest
|-- actionbarsherlock-i18n
|-- actionbarsherlock-samples
|-- SlidingMenu
|-- art
|-- example
|-- library
|-- library-maps-support
|-- TestProject
setting.gradle
include ':TestProject', ':libraries:SlidingMenu:library', ':libraries:ActionBarSherlock:actionbarsherlock'
build.gradle (Test Project)
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
dependencies {
compile project(':libraries:ActionBarSherlock:actionbarsherlock')
compile project(':libraries:SlidingMenu:library')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 11
targetSdkVersion 16
}
}
build.gradle (actionbarsherlock lib)
buildscript {
repositories {
maven { url 'http://repo1.maven.org/maven2' }
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android-library'
dependencies {
compile 'com.android.support:support-v4:13.0.0'
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 11
targetSdkVersion 16
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
}
build.gradle (slidingmenu lib)
buildscript {
repositories {
maven { url 'http://repo1.maven.org/maven2' }
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android-library'
dependencies {
compile 'com.android.support:support-v4:13.0.0'
compile project(':libraries:ActionBarSherlock:actionbarsherlock')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 11
targetSdkVersion 16
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
}

ActionBarSherlock (library) on Android Studio

I had the problem like wired00 on Problems importing project into Android Studio regarding ActionBarSherlock
I do exactly the solution (Edit2) but when I run I get
Gradle: package com.actionbarsherlock.app does not exist
Strange thing is that on code I don't get any error, just on compiling.
Update 1:
build.gradle:
buildscript {
repositories {
maven { url 'http://repo1.maven.org/maven2' }
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'
dependencies {
compile files('libs/android-support-v4.jar')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 16
}
}
MainActivity:
import android.os.Bundle;
import com.actionbarsherlock.app.SherlockActivity;
public class MainActivity extends SherlockActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
Module Settings:
Structure:
Error:
I think you need to add the following dependency in you gradle file:
compile project(':StoKit:actionbarsherlock')
(within the dependency section)
EDIT 25/05/2013
Ok, so this is my project structure which is currently compiling fine in android studio and via gradle command line:
EDIT 31/05/2013
Ok, so my build.gradle file within DecisionBuddy-DecisionBuddy module is:
buildscript {
repositories {
maven { url 'http://repo1.maven.org/maven2' }
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'
repositories{
mavenCentral()
}
dependencies {
compile project(':libraries:actionbarsherlock')
compile files('libs/GoogleAdMobAdsSdk-6.3.1.jar')
compile files('libs/libGoogleAnalyticsV2.jar')
compile files('libs/mobileservices-0.2.0.jar')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 16
}
}
And the one in the actionbarsherlock module is:
buildscript {
repositories {
maven { url 'http://repo1.maven.org/maven2' }
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android-library'
dependencies {
compile files('../../DecisionBuddy/libs/android-support-v4.jar')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 16
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
Does this help?
Also make sure you updated to the latest version of the tools - I was having some issues until I did that.
I had the same problem and solve it by adding
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
to the dependencies of the build.gradle of the slidingMunu library project.
here is my build.gradle
apply plugin: 'android-library'
dependencies {
compile 'com.android.support:support-v4:18.0.+'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
}
android {
compileSdkVersion 16
buildToolsVersion '20.0.0'
defaultConfig {
minSdkVersion 16
targetSdkVersion 21
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}

Categories

Resources