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

How to alter settings.gradle through renative.json #1247

Closed
VMBindraban opened this issue Nov 21, 2023 · 1 comment
Closed

How to alter settings.gradle through renative.json #1247

VMBindraban opened this issue Nov 21, 2023 · 1 comment
Assignees
Labels
question I have a question!
Milestone

Comments

@VMBindraban
Copy link

I am trying to add codepush but it requires some install steps. The documentation doesn't state anything about altering the settings.gradle and the existing plugins don't alter the settings.gradle to act like an example.

        "react-native-code-push": {
            "android": {
                "app/build.gradle": {
                    "apply": [
                        "from: \"{{PLUGIN_ROOT}}/codepush.gradle\""
                    ]
                },
                "settings.gradle": {
                    "project": [
                        "project(':react-native-code-push').projectDir = new File(\"{{PLUGIN_ROOT}}/android/app\")"
                    ],
                    "include": [
                        "':react-native-code-push'"
                    ]
                },
                "package": "com.microsoft.codepush.react.CodePush",
                "path": "{{PLUGIN_ROOT}}/android",
                "projectName": "react-native-code-push"
            },
            "version": "^8.1.0"
        },
FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not resolve project :react-native-code-push.
     Required by:
         project :app
      > No matching configuration of project :react-native-code-push was found. The consumer was configured to find a component for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.4.2' but:
          - None of the consumable configurations have attributes.
@RicardasN
Copy link
Collaborator

Hello, sorry for the somewhat late response, but the feedback was noted. We will add this functionality in release 1.0 of renative in a similar way to what was suggested - #1563

However, if for any reason a newer version of the project cannot be used, I'd recommend using overrides to inject the needed functionality manually.
More specifically you can create a settings.gradle file in appConfigs/base/builds/android. That will override anything renative tries to generate on a recreation of the project. However, do be aware, that in such case if you will plan to opt for a newer version of renative or change anything else, the newer changes will not be propagated and your provided settings.gradle will be used.

@pavjacko pavjacko added this to the 1.0 milestone May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question I have a question!
Projects
None yet
Development

No branches or pull requests

4 participants