I'm a newbie android app developer using android studio, and I am trying to use sticky list headers from https://github.com/emilsjolander/StickyListHeaders. I do this by File -> New -> Import Module and I add the dependency. However I am getting the error
Error:No such property: GROUP for class: org.gradle.api.publication.maven.internal.deployer.DefaultGroovyMavenDeployer
My project build.gradle is:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "testingapp.dylanzammit.com.anothernewproj"
minSdkVersion 21
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.0.1'
compile 'se.emilsjolander:stickylistheaders:2.7.0'
}
If you want to add the libraries to your project in Android studio, you can do it in three different ways. Please read this link https://stackoverflow.com/a/35369267/5475941. In this post I explained how to import your JAR files in Android studio and I explained all possible ways step by step with screenshots. I hope it helps.
Related
First i was created a folder to right click on my rootProject and create a direcotry(name library) and then i paste my downloaded library into library directory
here is my settings.gradle
include ':app'
include ':libraries:touchView'
and then i got to File->ProjectStructure>+ then dependancy tab and click on**+** select module dependany and select and press ok
here, is my build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.domore.loadlibrary"
minSdkVersion 14
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.1.1'
compile project(':libraries:touchView')
}
for few second my build.gradle file is sync after it gave me an error which is listed below
configuration with the name 'default' not found
i also seen this video on youtube
https://www.youtube.com/watch?v=1MyBO9z7ojk
please, helm me to solve this problem
I'm trying to import this custom view: https://github.com/zerokol/JoystickView into Android Studio by following these instructions: Importing a custom view in Android Studio.
So I go File -> New -> Import Module, leave everything as default and import.
I then get this error:
I clicked the link and updated everything to the latest versions but it still doesn't work.
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "jacobpihl.bluetoothcar"
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'])
compile 'com.android.support:appcompat-v7:23.1.0'
}
As it doesn't have any resources, you can just copy the class and put where you want in your project.
I have downloaded jar file of Loopj library and placed it in libs folder. have tried many changes but getting same error. Can anyone please help me to solve this.
build.gradle :-
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.example.pratik.receivedsms"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
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:22.2.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.loopj.android:android-async-http:1.4.8'
}
What worked for me is opening gradle terminal from android studio and executing the following command:
gradlew installarchives
It should also work without downloading the jar file.
Another note is that I am using version 1.4.5.
Good luck!
I've created an external library that I was hoping to make open source. I import it as a module without issue.
I have to resolve this issue after import:
Adding the dependency is what I want to do. I don't want to move it to :app.
When I add the dependency, the issue goes away. The import references the correct file. On build I get this issue:
I figure the solution has to be with referencing the java file in the build.gradle file for the external library but I couldnt find any good examples or even proof that this would resolve the issue.
library is the module name.
Thanks in advance.
Edit:
build.gradle for the app
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc3"
defaultConfig {
applicationId "com.weaverprojects.toundertest1"
minSdkVersion 21
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services-gcm:7.5.0'
}
build.gradle for library
apply plugin: 'com.android.library'
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc3"
defaultConfig {
minSdkVersion 19
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
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:22.2.1'
compile 'com.google.android.gms:play-services-gcm:7.5.0'
}
Settings.gradle
include ':app', ':library'
Assuming that your library exists as it's own project, and it'd path relative to the top level folder for your main project is ../mylibs/library/ I think your settings.gradle should change as follows:
project(':library').projectDir = new File('../mylibs/library/');
and the following needs to go inside the dependencies section of your main/app/build.gradle file (which I think is the first code dump in your question).
compile project(':library')
BTW, please consider renaming :library to something else (this is not the source of the problem but the name can be confusing when you look at it some months later)
I am using Android Studio 1.2. Every SDK must have AsyncTask , but my Android Studio is not able to recognize the class.Even not showing in import and autoassist.
Similarly if I write no suggestion in Autosuggest
Gradle Script:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "22.0.0"
defaultConfig {
applicationId "com.appxperts.printknot2"
minSdkVersion 11
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
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:22.1.1'
compile project(':libraries:floatingedittextlibrary')
compile files('libs/gson-2.2.4.jar')
compile 'com.larswerkman:HoloColorPicker:1.5'
compile 'com.doomonafireball.betterpickers:library:1.5.5'
compile 'com.google.android.gms:play-services:3.1.+'
}
I solved it myself.The problem was with Android Studio on Ubuntu.It is not able to automatically import AsycTask.Not even in auto-suggestions.Simply added
import android.os.AsyncTask