Giter Club home page Giter Club logo

Comments (34)

MaxChinni avatar MaxChinni commented on July 20, 2024 1

Using jcenter "fixed" the problem.
Maybe could be useful to add the note in the readme.
It should be sufficient to add jcenter to gradle repositories

repositories {
    mavenCentral()
    jcenter()
}

from libsuperuser.

afollestad avatar afollestad commented on July 20, 2024

He doesn't want to support Gradle, so unfortunately you have to create a new Library Module in your Android Studio project and manually copy in the required files from libsuperuser.

from libsuperuser.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on July 20, 2024

@afollestad I see. May I ask : How do you usually do those operations?
I'm a newb on Android-Studio (since Google officially ditched Eclipse), so I wonder what is the correct way to import using Gradle and without Gradle.

from libsuperuser.

afollestad avatar afollestad commented on July 20, 2024

@AndroidDeveloperLB when you have a project open, File > New Module.

Then you just drag and drop (or Ctrl+C/Cmd+C) files from libsuperuser into the correct folders of your new module. The package name and everything has to match.

from libsuperuser.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on July 20, 2024

@afollestad That's the official way? Isn't there a better way? On Eclipse, I just use the "import..." wizard...
Also, what do you do when you wish to add using Gradle?

from libsuperuser.

afollestad avatar afollestad commented on July 20, 2024

@AndroidDeveloperLB for Android Studio, yeah. It has a different project structure than Eclipse. Eclipse ADT is now retired, too, since Android Studio 1.0 was released.

from libsuperuser.

Chainfire avatar Chainfire commented on July 20, 2024

It's not that I don't want to support Gradle, more that I have absolutely no idea what I'm doing. And until I do, I won't be committed anything of the sort. If something Gradle-y needs updating or inclusion, you can open a PR like before.

from libsuperuser.

afollestad avatar afollestad commented on July 20, 2024

That's how I was before, too. It's simpler than you'd think. Once you figure out the basics, it's super easy :)

from libsuperuser.

Chainfire avatar Chainfire commented on July 20, 2024

And I will, once I actually start using it, and not a minute before :)

from libsuperuser.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on July 20, 2024

@Chainfire Are you an Eclipse fan like me?
:)

from libsuperuser.

Chainfire avatar Chainfire commented on July 20, 2024

I wouldn't consider myself a fan, no. I've used many IDEs in my life, and I certainly don't consider Eclipse to be the best. That being said, I started using it when I started developing for Android, and now I am comfortable with it. I don't have the time to waste right now to learn how either IntelliJ or Gradle works, and frankly I am annoyed I'm going to need to, for apparently no good reason other than some guys at Google think it's cool.

from libsuperuser.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on July 20, 2024

@Chainfire Well I'm very very used to Eclipse too. Really wished Google would continue working on it, or at least make the alternative as similar as possible to it and as easy as possible to migrate.
For about half of the projects out there on Github that use Gradle, I got weird issues importing and compiling, and even when I tried to migrate my own app I got weird errors that are way harder to understand than any error I've seen on Eclipse.

from libsuperuser.

afollestad avatar afollestad commented on July 20, 2024

Gradle is used because you can have a single project without downloading
separate projects and referencing them as libraries. You can reference them
with a version string and they're downloaded for you. If you do use library
projects from folders, you don't have to setup the dependencies every time
you setup a project on a different machine. They're saved in your Gradle file's
dependencies and aren't specific to any machine's paths or anything.

So basically it makes dependency management dramatically easier, especially
with open source libraries and team projects. It's not just because it's
cool.

from libsuperuser.

afollestad avatar afollestad commented on July 20, 2024

Gradle integrates with jCenter and any other Maven repositories, too. So again, if takes out the need to download dependencies and add them in as references on your own.

from libsuperuser.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on July 20, 2024

@afollestad Are there any benefits of using it this way, other than having less steps of importing libraries?
According to what I see, I can't see the code or at least not edit the code, and I don't think it has an auto-update (or reminder of updates) for the libraries. Also, I've noticed that it might take less steps, but it's way slower than just downloading libraries and importing them like on Eclipse. So I don't get what are the advantages of using it.

from libsuperuser.

afollestad avatar afollestad commented on July 20, 2024

How is it slower? Without it, you have to manually clone every library you're using. In some of my work projects, I have around 10 library dependencies. Before, if I reinstalled an OS on my laptop or used a different machine, I would have to clone 11 repositories and then figure out which ones depend on which.

Gradle does have auto update, too. You use a + sign in place of a version to use the latest.

from libsuperuser.

afollestad avatar afollestad commented on July 20, 2024

Whether it's 1.0.0, 1.0.+, 1.+, or +

from libsuperuser.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on July 20, 2024

@afollestad It has auto updates ? Cool ! Does it also mention what's new with each version it gets, and also give you a way to manually cause it to update?
Also, does it allow to tweak the libraries you clone (meaning to change their codes) ?

About being slower, that's what I noticed. It took me much less time to import libraries the normal way (using Eclipse) than to use Android-Studio. Also caused less issues.

from libsuperuser.

afollestad avatar afollestad commented on July 20, 2024

It doesn't integrate changelogs, but if a developer wanted to they could include changelogs on the repository a library is hosted on. For an example, I host daterial-dialogs on jCenter (the default Maven repository that Android Studio uses for Gradle dependencies) here: https://bintray.com/drummer-aidan/maven/material-dialogs/view

I could put changelogs on that page for each individual release if I wanted to, I put them on the GitHub repo instead though.

Generally libraries you reference with Gradle are published libraries that a developer would not want you to modify, like the Android Support Library for an example. Android Studio is slower when you're importing code from folders, but when you're copying and pasting 1-line strings to reference libraries it's much faster.

from libsuperuser.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on July 20, 2024

@afollestad Nice. I see I'm writing here too much. May I contact you by email? I can also see you on Hangouts...

from libsuperuser.

Chainfire avatar Chainfire commented on July 20, 2024

@afollestad great that you find those features useful - I certainly don't care as much about them as I care about the time needed to move from one system to another, unlearn the old, and learn the new. Eventually it will be done, as Google has dropped all Eclipse support so it's not like there's a choice, but it's certainly not a priority. Stabs like me not wanting to support it, or countering with how easy it is when I say I won't do it until I understand what I'm doing (which I think is pretty sane, but hey, that's just me), are certainly not progressing the case.

from libsuperuser.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on July 20, 2024

@Chainfire It's odd though.
I was sure that Google said on one of its lectures on Google IO (maybe fireside-chat) that they won't stop supporting ADT, but just focus on Android-Studio.
It's also odd they've decided it, as they tend to offer multiple choices for their users, and Eclipse is also one of the most popular IDEs out there.

from libsuperuser.

Chainfire avatar Chainfire commented on July 20, 2024

@afollestad I have actually started migrating to Android Studio today. A lot of what I'm doing is still Chinese, but I have looked shortly at uploading to jCenter. If you have some pointers, a good how-to, etc, it'd be most welcome as so far I'm not getting anywhere.

from libsuperuser.

afollestad avatar afollestad commented on July 20, 2024

@Chainfire nice! Well if you're familiar with Maven, you can put it on Maven Central instead of jCenter. Android Studio allows you to explicitly use Maven Central in addition to jCenter too. But jCenter is easier since it's there by default.

For jCenter, you just create a Maven repository on Bintray (https://bintray.com/), once you deploy your files you can add the repo to jCenter.

from libsuperuser.

Chainfire avatar Chainfire commented on July 20, 2024

I'm not familiar with Maven Central or jCenter. I did create a jCenter account. But I don't know what the steps are. I think (a) turn it into a Maven artifact and (b) publish that to jCenter - but I can't find any docs or examples on how to do this easily. It's seem all the things I can find use intermediate build systems/repos. How hard can this be?

from libsuperuser.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on July 20, 2024

@Chainfire Hey I'm a huge newb in this too. Can you please share your findings?
It might be useful in the future.

from libsuperuser.

Chainfire avatar Chainfire commented on July 20, 2024

Done.

For the dependency ( @afollestad ), see https://github.com/Chainfire/libsuperuser/blob/master/README.md

For the changes to get this working ( @AndroidDeveloperLB ) see
ec7f84c

from libsuperuser.

afollestad avatar afollestad commented on July 20, 2024

@Chainfire awesome, thank you!

from libsuperuser.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on July 20, 2024

@Chainfire Seems like a lot. Did you copy it from some existing/general projects?
How long did it take?

from libsuperuser.

Chainfire avatar Chainfire commented on July 20, 2024

I couldn't find a decent guide or example anywhere. So I first rolled my own which was significantly longer and didn't work as well. Then I ran into someone on IRC that gave me his script, and I adapted that.

from libsuperuser.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on July 20, 2024

@Chainfire I see. Thanks anyway.
So, now in order to add the dependency, I need to add this:

compile 'eu.chainfire:libsuperuser:201501111220'

?
It's a bit odd number. I've never seen such a format for dependency (of course, I've seen this format before, but not on Gradle) .
What if I want to add "+" , so that it will auto-update?

from libsuperuser.

Chainfire avatar Chainfire commented on July 20, 2024

The version number just identifies the minute it was built. libsuperuser has no real version number. Saves me the trouble of producing version numbers.

Anyway, I've prefixed it with '1.0.0', so now you can do:

dependencies {
compile 'eu.chainfire:libsuperuser:1.0.0.+'
}

That should work how you want it, no?

from libsuperuser.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on July 20, 2024

Yes, thank you again. You are the best!

from libsuperuser.

MaxChinni avatar MaxChinni commented on July 20, 2024

I'm sorry, but I cannot find the lib under the maven repo.
Using the instruction in the README.md I get

> Could not find any matches for eu.chainfire:libsuperuser:1.0.0.+ as no versions of eu.chainfire:libsuperuser are available.
  Searched in the following locations:
      https://repo1.maven.org/maven2/eu/chainfire/libsuperuser/maven-metadata.xml
      https://repo1.maven.org/maven2/eu/chainfire/libsuperuser/

Is the maven repo still active?

from libsuperuser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.