2

I want to export and import a gradle project which I used in Android with Eclipse.

Problems importing project into Android Studio regarding ActionBarSherlock

    android {
    compileSdkVersion 'Google Inc.:Google APIs:17'
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.matetek.Hello"
        minSdkVersion 14
        android:targetSdkVersion="23"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}
    dependencies {
    compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
    compile 'com.android.support:support-v4:18.0.+'
}

cannot use

import com.actionbarsherlock.app.ActionBar

import com.actionbarsherlock.app.SherlockFragmentActivity

also

Error:(10, 0) Cause: startup failed:
build file 'C:\Work\Hello\build.gradle': 10: Statement labels may not be used in build scripts.
In case you tried to configure a property named 'android', replace ':' with '=' or ' ', otherwise it will not have the desired effect.
 @ line 10, column 17.
           android:targetSdkVersion="23"

Help me

I'm sorry I`m not good at English

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
kimtaehun
  • 85
  • 2
  • 9

2 Answers2

4

First of all, 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, in this way you will able to use all the new features and the new support libraries (as the design support library).

Your issue is here.

defaultConfig {
        android:targetSdkVersion="23"
    }

Change this line in

defaultConfig {
        targetSdkVersion 23
    }

Pay attention.
You can't use together ActionbarSherlock and Appcompat library.

They use the same attributes.

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
2

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'
Madhukar Hebbar
  • 3,113
  • 5
  • 41
  • 69
  • As said by Gabriele Mariotti It's better to use **AppCompat** Lib http://stackoverflow.com/questions/7844517/difference-between-actionbarsherlock-and-actionbar-compatibility – Madhukar Hebbar Oct 27 '15 at 09:13