infinitered / solidarity

Solidarity is an environment checker for project dependencies across multiple machines.
https://infinitered.github.io/solidarity/
MIT License
639 stars 48 forks source link

Type error and infinite spinner #183

Closed TheAlmightyBob closed 6 years ago

TheAlmightyBob commented 6 years ago

(split off #181)

Seemingly starting with v2.0.0, solidarity (for a React Native project) shows:

TypeError: Cannot read property '1' of null

✔︎ Solidarity checks valid
⠧ Verifying Android

And it just spins forever on "Verifying Android."

Interestingly, adding --verbose outputs:

✔ Package JSON - ./package.json file
✔ CocoaPods - ./ios/Pods directory
✔ Watchman - watchman binary
✔ Android - ANDROID_HOME env
TypeError: Cannot read property '1' of null
✔ Yarn - yarn binary
✔ NPM - npm binary
✔ React Native - /usr/local/bin/react-native binary
✔ React Native - /usr/local/bin/react-native binary
✔ Node - node binary
✔ Xcode - xcrun binary
✔ Xcode - xcodebuild binary
✔ CocoaPods - pod binary

✔︎ Solidarity checks valid
✨  Done in 3.20s.

(as the "Done" indicates, it actually finishes in this case, rather than hanging as it does without the --verbose) (note that the absolute path on /usr/local/bin/react-native is just to work around #181, and is not necessary with v2.0.1, but the behavior is otherwise the same btw. 2.0.0 and 2.0.1)

solidarity snapshot does not have this issue.

In case it's relevant (the type error makes me wonder if Solidarity is looking for something that's missing in the snapshot?), the Android section of the snapshot is as follows:

    "Android": [
      {
        "rule": "env",
        "variable": "ANDROID_HOME",
        "error": "The ANDROID_HOME environment variable must be set to your local SDK.  Refer to getting started docs for help."
      },
      {
        "rule": "custom",
        "plugin": "React Native",
        "name": "androidVersion"
      }
    ],
GantMan commented 6 years ago

So we're using the env_info library for identifying the androidVersion, and I'm not 100% sure that works on all machines.

Can you help us understand if this is in the envinfo lib? Please install https://github.com/tabrindle/envinfo and let me know if it tells you the android sdk versions correctly.

TheAlmightyBob commented 6 years ago

@GantMan Looks correct to me.

    Android:
      Build Tools: 23.0.1, 25.0.0, 25.0.1, 25.0.3, 26.0.1, 26.0.2, 27.0.3
      API Levels: 23, 25, 26
GantMan commented 6 years ago

Found it! This was a bug in the android-finding code (which can be slightly different). The regex has been fixed to catch these issues and is now live. Please install solidarity-react-native latest which will be 2.0.1.

GantMan commented 6 years ago

btw, thanks for taking the time to file this issue @TheAlmightyBob

rhayart commented 6 years ago

Hi, getting the same problem on react-native with version 2.0.1. The "Verifying Android" display an infinite spinner.

ReferenceError: failMessage is not defined

✔︎ Solidarity checks valid
\ Verifying Android

Am i missing something ? Something new ?

Thanks

GantMan commented 6 years ago

Hiya @rhayart !

So it's not working eh? Any chance we can screen share so I can help figure this out?

rhayart commented 6 years ago

Unfortunatly im at the office and i can't do that... What informations could help you for that issue ?

GantMan commented 6 years ago

Are you 100% sure it's the verifying android step?

What happens when you install envinfo and run the envinfo CLI?

Please provide answers and output of both of those, here.

GantMan commented 6 years ago

Actually, I just found it!

https://github.com/infinitered/solidarity-react-native/blob/f40e87ad3d7dd35c93d61521d53d35dc1991b468/extensions/react-native.js#L41

Looks like I forgot an s! Will do a fix and roll it out now.

GantMan commented 6 years ago

@rhayart - released 2.0.2!!!!

rhayart commented 6 years ago

Great, the problem seam to be solve. Thanks