Fork me on GitHub
#clojure-android
<
2017-12-07
>
ibcoleman15:12:23

Hi, I’m trying to create a new project using lein new droid foobar but lein can’t find the template… Guessing I have to update some dependency somewhere. The lein-droid docs say “Lein-droid is a plugin for Leiningen, so you should make sure you have Leiningen 2.3 or higher installed. This is all installation you have to do.”

ibcoleman15:12:59

(sorry for the newbie question)

gdeer8116:12:23

@ibcoleman lein version will give you the version number (if you're new to clojure you probably have the latest version installed). But test that hypothesis and if it's greater than 2.3 then you can rule that out as a cause. My next hypothesis states that [lein-droid "0.4.3"] is not in your ~/.lein/profiles.clj file

ibcoleman16:12:32

thanks @gdeer81 The odd thing is it looks like it’s resolving http://clojars.org and maven to 127.0.0.1…

ibcoleman16:12:51

➜ Projects lein version

Could not transfer artifact lein-pprint:lein-pprint:jar:1.1.1 from/to central (): Connect to  [localhost/127.0.0.1] failed: Connection refused (Connection refused)
Could not transfer artifact lein-pprint:lein-pprint:jar:1.1.1 from/to clojars (): Connect to  [localhost/127.0.0.1] failed: Connection refused (Connection refused)
Could not transfer artifact lein-pprint:lein-pprint:pom:1.1.1 from/to central (): Connect to  [localhost/127.0.0.1] failed: Connection refused (Connection refused)
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.

ibcoleman16:12:22

but if I just ping http://clojars.org or http://maven.org from the cl I get a normal resolution

gdeer8116:12:53

Then lets follow the hypothesis that network configuration is preventing lein from connecting to clojars and maven

ibcoleman16:12:45

if I just do lein new app foobar a new project is created w/ no issues. If I try to add any dependencies, it tries to pull them from localhost for some reason…

gdeer8116:12:51

yes, this supports our hypothesis that it's a network issue since lein can use things are already on your machine

ibcoleman16:12:28

and yet:

➜  foobar ping 
PING  (151.101.201.128): 56 data bytes
64 bytes from 151.101.201.128: icmp_seq=0 ttl=59 time=7.657 ms
64 bytes from 151.101.201.128: icmp_seq=1 ttl=59 time=7.477 ms
64 bytes from 151.101.201.128: icmp_seq=2 ttl=59 time=4.471 ms
Wonder where lein is getting its name resolution from?

gdeer8116:12:16

ah yes, my hypothesis wasn't concise enough. The cause must be from a lein configuration. one I don't think I've ever seen before

gdeer8116:12:38

So where are the points that we can configure lein?

gdeer8116:12:02

what does your ~/.lein/profiles.clj look like?

ibcoleman16:12:34

currently no ~/.lein/profiles.clj (i moved it to .old)

ibcoleman16:12:54

(since there wasn’t a default one created initially by leiningen)

gdeer8116:12:21

what version of leiningen are you using?

ibcoleman16:12:29

➜  foobar lein version                
Leiningen 2.8.1 on Java 1.8.0_112 Java HotSpot(TM) 64-Bit Server VM
(on a mac)

gdeer8116:12:34

oh wow I just noticed I am still on 2.7; let me upgrade so any tests I run will match closer with your situation

gdeer8116:12:49

hrm, I also upgraded to 2.8 on my ubuntu laptop since the environment might be closer to a mac

gdeer8116:12:44

I moved my profiles.clj as well and did lein new droid foo and it worked on that machine as well

gdeer8116:12:32

do you have any other random files in your ~/.m2 or ~/.lein directories? Our hypothesis has boiled down to some random configuration somewhere is messing with leins idea of where the central repos are

ibcoleman16:12:47

Hmm, not that I can see:

➜  .lein ls -la ~/.lein
total 16
drwxr-xr-x   5 ian  staff   160 Dec  7 11:08 .
drwxr-xr-x+ 64 ian  staff  2048 Dec  7 11:54 ..
-rw-r--r--   1 ian  staff   136 Dec  7 11:03 profiles.clj.old
-rw-r--r--   1 ian  staff    28 Dec  7 10:36 repl-history
drwxr-xr-x   3 ian  staff    96 Dec  7 09:43 self-installs
➜  .lein ls -la ~/.m2 
total 0
drwxr-xr-x   3 ian  staff    96 Jan 12  2017 .
drwxr-xr-x+ 64 ian  staff  2048 Dec  7 11:54 ..
drwxr-xr-x  73 ian  staff  2336 Dec  7 10:52 repository

gdeer8116:12:24

do you still have any old self installs?

ibcoleman16:12:52

no, this is the first install on this machine. via brew install clojure && brew install leiningen

gdeer8117:12:55

and are there any random files in the directory where you are running lein new ?

ibcoleman17:12:22

hmm. nothing but folders in there.

gdeer8117:12:58

okay, just to rule out OS level stuff can you boot into a guest session and install and run leiningen?

ibcoleman17:12:52

hey @gdeer81, I ran out of time--thanks for all your help--gotta hit this meeting though. Thanks again!

gdeer8117:12:08

it probably would have been better to move this conversation to #leiningen since there probably are more people in that channel that would have insight into what might be causing the issue

gdeer8117:12:36

oh nevermind, you did ask it there as well. Daniel said it may be an environmental variable which the guest user log in might have ruled out