razorpay / razorpay-flutter

Razorpay Flutter Plugin
MIT License
106 stars 144 forks source link

namespace missing in build.gradle #373

Open jerrypaulsam opened 3 months ago

jerrypaulsam commented 3 months ago

Please provide all the information requested. Issues that do not follow this format are likely to stall.

Description

* What went wrong:
A problem occurred configuring project ':razorpay_flutter'.
> Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
   > Namespace not specified. Specify a namespace in the module's build file. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.

Flutter Version :

Flutter (Channel stable, 3.19.4, on macOS 14.2.1 23C71 darwin-arm64, locale en-IN)

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Update the sdkVersion to 34
  2. Build app bundle or apk

Expected Results

To successfully build the package.

manubodhi commented 3 months ago

We are experiencing the same issue, please migrate the project to sdk 34, add namespace to the build.gradle

manubodhi commented 3 months ago

This is what they commented for the earlier issue, this is a duplicate issue, Please try this.

dependencies:
  razorpay_flutter:
    git:
      url: https://github.com/OutdatedGuy/razorpay-flutter
      ref: stable

this is not working either, the package cannot be imported in files after adding to pubspec, it's not showing.

manubodhi commented 3 months ago

You can add this small snippet inside your project level build.gradle before the already existing subprojects block, and it will run, you can use this workaround for now until Razorpay releases an update.

subprojects {
    afterEvaluate { project ->
        if (project.hasProperty('android')) {
            project.android {
                if (namespace == null) {
                    namespace project.group
                }
            }
        }
    }
}

<YOUR REST OF THE BUILD.GRADLE CODE after this line>
rootProject.buildDir = '../build'
subprojects {
    project.buil.....................................................................
    .........................................................................................
}

https://stackoverflow.com/a/77625024/6507679

aliasgar4558 commented 2 months ago

++ Facing the same issue & unable to build without this workaround. We have to update the compile SDK to latest & also need to specify its namespace.

traditionalwears commented 1 month ago

I thinks its waste of time to depend on razorpay, such a horrible experience. There is no way to connect anyone for the support. I've been trying integrate the razorpay on flutter app, my app is in production still because of these issues with flutter plugin couldn't able to add to my app, and no one is responding.

vivekshindhe commented 1 month ago

Hey folks, version 1.3.7 was released in razorpay-flutter. This will fix the namespace and package_info_plus issues.

Please try with this version. I'll be keeping this ticket open for a while. Please let me know if you are facing any issues with the upgrade.