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

build.gradle not found #234

Open
kevinvangelder opened this issue Dec 29, 2018 · 11 comments
Open

build.gradle not found #234

kevinvangelder opened this issue Dec 29, 2018 · 11 comments

Comments

@kevinvangelder
Copy link
Member

kevinvangelder commented Dec 29, 2018

Solidarity & solidarity-react-native are installed globally. solidarity snapshot worked fine, but solidarity returns:

✖ ./android/app/build.gradle not found
/Users/kvg/.config/yarn/global/node_modules/gluegun/build/index.js:13
    throw up;
    ^

TypeError: Cannot read property 'getAndroidSDKInfo' of undefined
    at module.exports (/Users/kvg/code/apps/project/node_modules/solidarity-react-native/extensions/helpers/getAndroidEnvData.js:16:37)
@tabrindle
Copy link
Contributor

tabrindle commented Dec 29, 2018

I think this should fix it. infinitered/solidarity-react-native#30

This was my bad. Upgraded envinfo in solidarity but not its usage in this plugin. 🤦‍♂️

@Pushplaybang
Copy link

@tabrindle @kevinvangelder I'm still experiencing this issue with the following deps:

   "solidarity": "^2.3.1",
   "solidarity-react-native": "^2.1.2"

@is343
Copy link

is343 commented Mar 25, 2019

I'm also still getting this.

   "solidarity": "^2.3.1",
   "solidarity-react-native": "^2.1.2"

I've got my android sdk path setup in ./android/local.properties

the Android section of my snapshot is reading as:


    "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"
      }
    ],

Solidarity is spitting out this error:

✖ The ANDROID_HOME environment variable must be set to your local SDK.  Refer to getting started docs for help.
✖ ./android/app/build.gradle not found

Solidarity checks failed.
error Command failed with exit code 1.

If I remove the Android section from the snapshot, everything passes, but that's obviously a less than ideal solution.

@GantMan
Copy link
Member

GantMan commented Apr 2, 2019

Sorry for the delay on this. I'll be trying to take a look at this whenever I can.

I don't think that the current code actually adheres to local.properties, but it wouldn't be hard to add it if not. Would you be interested in adding that code? I'd be happy to assist you. If not, I'll keep it on my TODO, and update when I can take care of it.

@is343
Copy link

is343 commented Apr 2, 2019

@GantMan sure, I can do that. Would you mind helping me get started by pointing to where the logic is, or a general idea on what needs to be done?

@GantMan
Copy link
Member

GantMan commented Apr 5, 2019

Yup!

So in solidarity-react-native located here: https://github.com/infinitered/solidarity-react-native

All the code for checking is here: https://github.com/infinitered/solidarity-react-native/blob/master/extensions/react-native.js

I hope this helps. Feel free to ask questions as you get started.

@kaushal9678
Copy link

As @tabrindle mentioned above you can change following lines of code in directory

1st file to modify

node_module/solidarity-react-native/react-native.js

add **await ** before getAndroidEnvData

check: async (rule, context) => {
          const {
            androidAppGradle,
            availableApiVersions,
            availableBuildToolsVersions,
            projectApiVersion,
            projectBuildToolsVersion
          } = await  getAndroidEnvData(context); 

2nd place to add in same file

report: async (rule, context, report) => {
          const { print } = context;
          const { colors } = print;
          const {
            androidAppGradle,
            availableApiVersions,
            availableBuildToolsVersions,
            projectApiVersion,
            projectBuildToolsVersion
          } = await getAndroidEnvData(context);

2nd File to Modify

node_module/solidarity-react-native/helpers/getAndroidEnvData.js
changes these lines

 availableApiVersions: androidData["API Levels"],
      availableBuildToolsVersions: androidData["Build Tools"],

like following

availableApiVersions: androidData[1]["API Levels"],
 availableBuildToolsVersions: androidData[1]["Build Tools"],

@loiclouvet
Copy link
Collaborator

Thanks @kaushal9678. Should we merge this ?

@FrederickEngelhardt
Copy link

Will this be fixed?

@GantMan
Copy link
Member

GantMan commented Jan 29, 2020

Would you like to send the PR? As long as it passes the tests, we can merge.

@anfriis
Copy link

anfriis commented Aug 7, 2020

Thanks, this fix works for me as well 👍🏼

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

9 participants