skip to Main Content

I was using Isar Database in my Flutter application. with the latest Flutter update I made
‘* What went wrong:
An exception occurred while implementing the plugin request [id: ‘com.android.application’]

Failed to apply plugin ‘com.android.internal.version-check’.
The minimum supported Gradle version is 8.0. The current version is 7.4.2. If you are using gradle wrapper, try editing the distributionUrl in /Users/oguzaytar/Desktop/tfon_mobile/tfonmobile/android/gradle/wrapper/gradle-wrapper.properties to gradle-8.0-all.zip.
I am getting an error like this.
When I change the gradle version of the application to 8.x, the isar_flutter_libs dependency does not have a namespace property, so I get the error ;

‘There was a problem configuring project ‘:isar_flutter_libs’.

Failed to create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
The namespace is not specified. Please specify a namespace in the module’s build.gradle file as follows:

 android {
     namespace 'com.example.namespace'
 }

I get an error like ‘.
I could not find a solution.

I forked the Isar Package and made the changes here (I changed the AGP version to 8.x and added Namespace) but I got an error that the IsarLink property is not defined.

It is not possible to use it as given in the documentation.

2

Answers


  1. Chosen as BEST ANSWER

    By adding the following code block to the android/build.gradle file content

    An exception occurred while implementing a plugin request [id: 'com.android.application']

    I have fixed the error.

    subprojects {
      // fix for verifyReleaseResources
      // ============
      afterEvaluate { project ->
        if (project.plugins.hasPlugin(“com.android.application”) ||
          project.plugins.hasPlugin(“com.android.library”)) {
          project.android {
            compileSdkVersion 34
            buildToolsVersion “34.0.0”
          }
        }
        if (project.hasProperty(“android”)) {
          project.android {
            if (namespace == null) {
              namespace project.group
            }
          }
        }
      }
      // ============
      project.buildDir = “${rootProject.buildDir}/${project.name}”
      project.evaluationDependsOn(“:app”)
    }
    

  2. The main isar package is quite outdated, you can try community version

     isar:
        hosted:
          name: isar
          url: https://pub.isar-community.dev/
        version: ^3.0.0
    
      isar_flutter_libs:
        hosted:
          name: isar_flutter_libs
          url: https://pub.isar-community.dev/
        version: ^3.0.0
       
    
    dev_dependencies:
      isar_generator:
        hosted:
          name: isar_generator
          url: https://pub.isar-community.dev/
        version: ^3.0.0
    
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search