getting the error: A problem occurred configuring project ':sign_in_with_apple'

650 Views Asked by At

i built a flutter application which i am planning to deploy on app center using the CI/CD of code magic, i have the workflow ready on codemagic for release but first i need to build the apk. so i added the key.properties file in which i add the path of keytore file, the alias and the store and key passwords. i updated the build.gradle file in android/app directory so that it contains signing configs of the android app. when running flutter build apk in the root of the project, im getting the below error: A problem occurred configuring project ':sign_in_with_apple'.

Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl. Namespace not specified. Please specify a namespace in the module's build.gradle file like so:

 android {
     namespace 'com.example.namespace'
 }

here is my build.gradle file in android/app:

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
    namespace 'com.example.justice_accelerator'
    compileSdkVersion flutter.compileSdkVersion
    ndkVersion flutter.ndkVersion
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }

    defaultConfig {
        applicationId "com.example.justice_accelerator"
        minSdkVersion 19
        targetSdkVersion 33
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }
    signingConfigs {
        release {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
            storePassword keystoreProperties['storePassword']
        }
    }

    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
    }
}
flutter {
    source '../..'
}

i found out that 'sign-in-with-apple' package is part of supabase flutter package and this is my pubsec.yaml file in which i tried to exclude this package but didnt work.

``name: justice_accelerator
description: justice accelerator application for the juvenile court in Mount Lebanon - Community Service Project

# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
  sdk: '>=2.12.0 <3.0.6'
dependencies:
  flutter:
    sdk: flutter

  supabase_flutter: ^1.10.6
  file_picker: ^5.3.2
  flutter_dotenv: ^5.1.0
  flutter_launcher_icons: ^0.13.1

dev_dependencies:
  flutter_test:
    sdk: flutter

 
  flutter_lints: ^2.0.0
exclude:
  - packages/supabase/lib/auth/apple.dart
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter packages.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
    - assets/logo-white.png
    - assets/logo-black.png
    - assets/logo-motiv-black.png
    - assets/logo-motiv-white.png
    - assets/logo-black-icon-only.png
    - .env.local`
1

There are 1 best solutions below

0
On

There was an issue with the older apple sign in package. Once you upgrade the supabase_flutter package to the latest release, this error should go away.