6

I'm using new Android studio, based on IDEA, and trying to build project with ABS library in dependencies for the main module. And I'm getting errors:

Gradle: package com.actionbarsherlock.app does not exist
Gradle: cannot find symbol class SherlockActivity
Gradle: package com.actionbarsherlock.view does not exist
Gradle: cannot find symbol variable super
Gradle: cannot find symbol method setContentView(int)
....

Why and how to fix it?

artem
  • 16,382
  • 34
  • 113
  • 189

3 Answers3

3

I used build ok.

buildscript {
repositories {
    mavenCentral()
}
dependencies {
    classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android-library'

dependencies {
       compile 'com.android.support:support-v4:13.0.0'
}

android {
compileSdkVersion 17
buildToolsVersion "17"

defaultConfig {
    minSdkVersion 7
    targetSdkVersion 17
}
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')
}
}
Crossle Song
  • 10,104
  • 2
  • 29
  • 38
1

I was putting this as a comment because I wasn't sure if its your exact issue but it looks like abs isn't added as a module correctly. So I added as an answer

Try download abs fresh, extract it then in Android Studio - file > import module... and import the actionbarsherlock directory. After this however I had a error relating to junit so check the last steps in below post

Follow the steps here: Problems importing project into Android Studio regarding ActionBarSherlock

That post isn't your exact issue but the steps got abs working for me. so try that within your existing project

Community
  • 1
  • 1
wired00
  • 13,930
  • 7
  • 70
  • 73
1

I did the import module, but i still had to add ActionBarSherlock as a dependency and then that got it working.

(actually i had the toplevel exception for mismatched support libs too, but then i got it working)

mlmkvr
  • 11
  • 1