gabrimatic / restart_app

A Flutter plugin that helps you to restart the whole Flutter app with a single function call by using native APIs.
https://pub.dev/packages/restart_app
MIT License
72 stars 63 forks source link

build show error when this package is installed #30

Closed MojtabaMohammadzadeh closed 1 month ago

MojtabaMohammadzadeh commented 3 months ago

Hi . I upgrade my flutter version and build.gradle to new version and now it show this error when I need to build Failed to query the value of property 'buildFlowServiceProperty'.

Could not isolate value org.jetbrains.kotlin.gradle.plugin.statistics.BuildFlowService$Parameters_Decorated@2e73340a of type BuildFlowService.Parameters A problem occurred configuring project ':restart_app'. 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: C:\Users\mojtaba\AppData\Local\Pub\Cache\hosted\pub.dev\restart_app-1.2.1\android\build.gradle. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.

MojtabaMohammadzadeh commented 3 months ago

I also have this Issue

willnode commented 2 months ago

Same

deyvison-cruz commented 2 months ago

Hello everybody!

I managed to solve my problem by adding the following snippet to my project's build.gradle file:

name_of_your_project/android/build.gradle:

allprojects {
    ...
    subprojects {
        afterEvaluate { project ->
            //This solves the namespace problem
            if (project.hasProperty('android')) {
                project.android {
                    if (namespace == null) {
                        namespace project.group
                    }
                }
            }
            //And this solves the next one that will arise after solving the first: Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (1.8) and 'compileDebugKotlin
            if (project.plugins.hasPlugin('kotlin-android') || project.plugins.hasPlugin('kotlin')) {
                project.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
                    kotlinOptions {
                        jvmTarget = '1.8'
                    }
                }
            }
        }
    }
}

Refs:

Hope it helps!

gabrimatic commented 1 month ago

The namespace has been added in the new version 1.3.0