Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import error: Error:No such property: OSSRH_USERNAME for class: ... #19

Closed
AndroidDeveloperLB opened this issue Mar 14, 2015 · 14 comments
Closed

Comments

@AndroidDeveloperLB
Copy link

I keep getting this error when trying to import the project into Android-Studio:

Error:No such property: OSSRH_USERNAME for class: org.gradle.api.publication.maven.internal.ant.DefaultGroovyMavenDeployer

What is this? How can I fix this?

@KennyGoers
Copy link

Go to the graddle.settings file and add the defs or comment out the publish bits from the build file. poke around and you should find it.

@AndroidDeveloperLB
Copy link
Author

which file exactly, and what exactly to put there ? Only similar file is "settings.gradle" , and its content is just that:

include ':recyclerviewfastscroller'
include 'Application'

@AndroidDeveloperLB
Copy link
Author

I think this is the cause to the issue:
untitled20150321212643
It says :
" 'dependencies' cannot be applied to '(groovy.lang.Closure)' "

@IlyaEremin
Copy link

You need only recyclerviewfastscroller folder to import library into your project.
After that put these constants:

ext {
    compileSdkVersion = 21
    buildToolsVersion = '21.1.1'
    targetSdkVersion = 21
    minSdkVersion = 14
    versionCode = 0
    versionName = "0.1.0"
}

to your build.gradle root file
and remove

apply from: 'gradle-maven-push.gradle'
afterEvaluate {
    androidJavadocs.classpath += project.android.libraryVariants.toList().first().javaCompile.classpath
}

from build.gradle in recyclerviewfastscroller folder

then add include ':recyclerviewfastscroller' to your settings.gradle root file. And then add compile project(':recyclerviewfastscroller') to your project build.gradle file. Read more about importing projects here: http://stackoverflow.com/questions/16718026/how-to-build-an-android-library-with-android-studio-and-gradle

@IlyaEremin
Copy link

@danoz73 I successfully imported library as project to android studio. This is no problem with the project. Issue can be closed.

@AndroidDeveloperLB
Copy link
Author

@IlyaEremin I don't understand. How did you import the project (library&sample) without any needed step? Why do I keep getting this error?
I just try to import it like any other Github project :
VCS-> Checkout from version control -> Git -> "https://github.com/danoz73/RecyclerViewFastScroller.git" ->Clone .

@IlyaEremin
Copy link

@AndroidDeveloperLB I updated previous comment, please read it :)

@IlyaEremin
Copy link

@AndroidDeveloperLB sorry, I think that you want to just import library itself without sample. You can compile sample just by deleting

apply from: 'gradle-maven-push.gradle'
afterEvaluate {
    androidJavadocs.classpath += project.android.libraryVariants.toList().first().javaCompile.classpath
}

from recyclerviewfastscroller/build.gradle

@AndroidDeveloperLB
Copy link
Author

@IlyaEremin I don't understand what you mean. Do you suggest creating a new project, downloading only the library part, and import it as a module?
If so, this is a lot more steps than the way I know of, and it also won't import the sample to test it.

EDIT: ok, I will try.

EDIT:
but the content has an extra line:

apply from: 'gradle-maven-push.gradle'

afterEvaluate {
    androidJavadocs.classpath += project.android.libraryVariants.toList().first().javaCompile.classpath
}

Should I delete all of those?

@AndroidDeveloperLB
Copy link
Author

ok, I've deleted both and now it works. What do those lines do anyway?

@IlyaEremin
Copy link

@AndroidDeveloperLB something related with uploading on maven. I don't know exactly what but it doesn't affect on library using.

@AndroidDeveloperLB
Copy link
Author

Thank you for helping. I think you should check it out, as I never had this issue on other repositories (thought I do have other issues from time to time).

@danoz73
Copy link
Owner

danoz73 commented Apr 16, 2015

Thanks for identifying this issue.

Those lines were, by default, including the configuration of the maven upload task that I have for my own convenience. I have now made it a requirement to specifically specify a gradle property (recyclerviewfastscroller.uploadScript) in order to actually use the uploadArchives task.

Thanks to @timroes for a nice solution to this issue!

@AndroidDeveloperLB
Copy link
Author

I don't understand, but thank you for fixing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants