I'm trying to import the swipelistview library to use on my project but I'm getting the following error.
http://i.imgur.com/ruxwkvv.png
I used this guide to get everything set up.
https://modewagon.wordpress.com/2013/09/16/getting-started-with-swipelistview/
I'm not sure exactly what the problem is or how I can fix it. Any help is appreciated.
This is the swipelistview build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
}
apply plugin: 'android-library'
dependencies {
compile 'com.android.support:support-v4:21.0.3'
compile files ('libs/nineoldandroids-2.4.0.jar')
}
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
and this is the one in my app folder:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.sda_app.sda"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
debug {
debuggable true
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile project(':libraries:swipelistview')
}
Related
For image processing i want to sync tessaract OCR in Android..i dont knw how to sync..!! when i tried to do some changes it shows "gradle sync failed"..
Here is setting.gradle and build.gradle
// setting.gradle:
include ':app'
include ':libraries:tess-two'
build.gradle of MyApplication:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.raghavan.myapplication"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
}
build.gradle of tess-two:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
}
}
apply plugin: 'android-library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 23
}
sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
res.srcDirs = ['res']
jniLibs.srcDirs = ['libs']
}
}
please help me , i got bellow error.
I am try to integrate "onyxenrollwizardsampleapp" Sample app in my Project as a module, but getting below error.
//Module app:
apply plugin: 'com.android.library'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
android{
compileSdkVersion 19
buildToolsVersion "22.0.1"
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
lintOptions {
abortOnError false
}
compileOptions {
}
}
repositories{
mavenCentral()
maven {
url 'http://nexus.diamondfortress.com/nexus/content/repositories/releases'
}
maven {
url 'http://nexus.diamondfortress.com/nexus/content/repositories/snapshots'
}
}
dependencies{
compile 'com.dft.android:onyx-enroll-wizard:4.1.3'
}
**//project app:
build.grade:**
epositories{
mavenCentral()
}
apply plugin: 'com.android.application'
buildscript{
repositories {
mavenCentral() // or jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
}
}
dependencies{
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':onyxenrollwizardsampleapp')
}
android{
compileSdkVersion 19
buildToolsVersion "22.0.1"
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')
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
allprojects {
repositories {
jcenter()
}
}
Getting Error:
Error:Failed to resolve: com.dft.android:onyx-enroll-wizard:4.1.3
At first modify your build.gradle
You can use apply plugin: 'com.android.application' instead of apply plugin: 'com.android.library'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "" // Set Yours
minSdkVersion 14
targetSdkVersion 22
}
Finally
apply plugin: 'com.android.application'
android{
compileSdkVersion 22
buildToolsVersion "22.0.1"
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
lintOptions {
abortOnError false
}
compileOptions {
}
}
repositories{
mavenCentral()
maven {
url 'http://nexus.diamondfortress.com/nexus/content/repositories/releases'
}
maven {
url 'http://nexus.diamondfortress.com/nexus/content/repositories/snapshots'
}
}
dependencies{
compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.dft.android:onyx-enroll-wizard:4.1.3'
}
Then Build menu - Clear Project and Rebuild Project .
I need to write a small library with submodules. When i try sync my project i get error.
if i use gradle gradle:1.0.1
Error:Configuration with name 'default' not found.
if build:gradle:1.2.3
Error:Cause: failed to find target 21
but this sdk already installed.
Here is my build.gradle
uildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
}
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 9
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile project(':libs:UniversalImageLoader')
}
project(':libs:UniversalImageLoader') {
apply plugin: 'com.android.library'
android.compileSdkVersion = 21
android.buildToolsVersion = "21.1.2"
android.sourceSets.main {
manifest.srcFile 'library/AndroidManifest.xml'
java.srcDirs = ['library/src']
res.srcDirs = ['library/res']
}
}
Any ideas on this subject? Thx for help.
I'm trying to use gradle to build my Android project wit Android Annotations but I still get errors. In my java classes AA is not found.
Also in gradle file I get some hints:
versionName "1.0" <- 'versionName' cannot be applied to '(java.lang.String)'
'main' in 'build' cannot be applied to '(groovy.lang.Closure)'
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java', 'GENERATED_FOLDER']
resources.srcDirs = ['src/main/resources']
res.srcDirs = ['src/main/res']
assets.srcDirs = ['src/main/assets']
}
Below is my full gradle script:
buildscript {
repositories {
mavenCentral()
}
dependencies {
// replace with the current version of the Android plugin
classpath 'com.android.tools.build:gradle:0.9.2'
// the latest version of the android-apt plugin
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.1'
}
}
repositories {
mavenCentral()
mavenLocal()
}
apply plugin: 'android'
apply plugin: 'android-apt'
def AAVersion = '3.0.1'
dependencies {
// Android annotations
apt "org.androidannotations:androidannotations:$AAVersion"
compile "org.androidannotations:androidannotations-api:$AAVersion"
compile 'com.android.support:appcompat-v7:19.+'
compile fileTree(dir: 'libs', include: ['*.jar'])
// ORMLite
compile 'com.j256.ormlite:ormlite-android:4.46'
// Google Guava
compile 'com.google.guava:guava:16.0.1'
}
apt {
arguments {
androidManifestFile variant.processResources.manifestFile
resourcePackageName 'pl.grzeslowski.weaselmoney'
}
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 10
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java', 'GENERATED_FOLDER']
resources.srcDirs = ['src/main/resources']
res.srcDirs = ['src/main/res']
assets.srcDirs = ['src/main/assets']
}
}
}
This is log from my console in Android Studio:
Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0
:weasel_moneyWeaselMoney:help
Welcome to Gradle 1.10.
To run a build, run gradle <task> ...
To see a list of available tasks, run gradle tasks
To see a list of command-line options, run gradle --help
BUILD SUCCESSFUL
Total time: 6.111 secs
Process finished with exit code 0
Dont put your AA configuration on your General build.gradle
put it in your app folder inside build.gradle, look # this example
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
def AAVersion = '3.2'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}
apt {
arguments {
androidManifestFile variant.outputs[0].processResources.manifestFile
resourcePackageName 'com.example.app'
logLevel 'TRACE' //Use this to get AA log
logAppenderConsole 'true' //Use this to get AA log
}
}
android {
compileSdkVersion 19
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.app"
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt')
}
debug {
debuggable true
}
}
packagingOptions {
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
}
}
dependencies {
//Libs
compile fileTree(dir: 'libs', include: ['*.jar'])
//Dependency
compile 'com.android.support:appcompat-v7:20.0.0'
compile 'org.springframework.android:spring-android-rest-template:2.0.0.M1' //If you're using REST
compile 'com.google.code.gson:gson:1.7.2'
compile 'org.codepond:wizardroid:1.3.0'
//Android Annotations
apt "org.androidannotations:androidannotations:$AAVersion"
compile "org.androidannotations:androidannotations-api:$AAVersion"
}
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']
}
}
}