-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterplatform-androidAndroid applications specificallyAndroid applications specificallyt: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on Androidteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
Use case
Currently, when using the flutter create command to initialize a new Flutter project, the generated Android build.gradle file looks something like that :
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
well now '.buildDir' is deprecated so an alternative solution may be using '.layout.buildDirectory' instead so it well be :
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.layout.buildDirectory = '../build'
subprojects {
rootProject.layout.buildDirectory= "${rootProject.layout.buildDirectory}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.layout.buildDirectory
}
Proposal
when trying to do that android studio doesn't say anything but gradle is yelling this :
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\bougara computer\StudioProjects\open_food_facts_api_flutter\android\build.gradle' line: 13
* What went wrong:
A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
> Could not create service of type ProjectScopedCacheBuilderFactory using WorkerSharedProjectScopeServices.createProjectScopedCache().
> Illegal char <:> at index 206: C:\Users\bougara computer\StudioProjects\open_food_facts_api_flutter\android\app\property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, C:\Users\bougara computer\StudioProjects\open_food_facts_api_flutter\build))\app\tmp\.cache
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 5s
Error: Gradle task assembleDebug failed with exit code 1
asaarnak and iapicca
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterplatform-androidAndroid applications specificallyAndroid applications specificallyt: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on Androidteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.