clojure-android

2017-12-07T15:12:23.000498Z

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.”

2017-12-07T15:12:59.000478Z

(sorry for the newbie question)

gdeer81 2017-12-07T16:05:23.000734Z

@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

2017-12-07T16:06:32.000395Z

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

2017-12-07T16:06:51.000863Z

➜ Projects lein version

Could not transfer artifact lein-pprint:lein-pprint:jar:1.1.1 from/to central (<https://repo1.maven.org/maven2/>): 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 (<https://repo.clojars.org/>): 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 (<https://repo1.maven.org/maven2/>): 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.

2017-12-07T16:07:22.000155Z

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

gdeer81 2017-12-07T16:08:53.000169Z

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

2017-12-07T16:10:45.000285Z

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…

gdeer81 2017-12-07T16:11:51.000531Z

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

2017-12-07T16:14:28.000698Z

and yet:

➜  foobar ping <http://repo.clojars.org|repo.clojars.org>
PING <http://v.ssl.global.fastly.net|v.ssl.global.fastly.net> (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?

gdeer81 2017-12-07T16:17:16.000174Z

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

gdeer81 2017-12-07T16:17:38.000472Z

So where are the points that we can configure lein?

gdeer81 2017-12-07T16:18:02.000613Z

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

2017-12-07T16:19:34.000110Z

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

2017-12-07T16:19:54.000372Z

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

gdeer81 2017-12-07T16:20:21.000049Z

what version of leiningen are you using?

2017-12-07T16:22:29.000524Z

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

gdeer81 2017-12-07T16:27:34.000144Z

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

2017-12-07T16:29:50.000411Z

thanks!

gdeer81 2017-12-07T16:41:49.000230Z

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

gdeer81 2017-12-07T16:42:44.000018Z

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

gdeer81 2017-12-07T16:49:32.000153Z

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

2017-12-07T16:54:47.000212Z

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

gdeer81 2017-12-07T16:55:24.000900Z

do you still have any old self installs?

2017-12-07T16:59:52.000687Z

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

gdeer81 2017-12-07T17:07:55.000752Z

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

2017-12-07T17:09:22.000102Z

hmm. nothing but folders in there.

gdeer81 2017-12-07T17:11:58.000080Z

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

2017-12-07T17:19:52.000436Z

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

gdeer81 2017-12-07T17:22:08.000515Z

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

gdeer81 2017-12-07T17:24:36.000097Z

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