2

I have created a Flutter project in Android Studio (Bumblebee | 2021.1.1 Patch 3). When I open the android folder in a seperate window, when the gradle syncing is being executed, it fails with the message Gradle project sync failed. Basic functionality(e.g. editing,debugging) will not work properly. I ran ./gradlew --warning-mode all in the command line and it's output is

Configure project :app
The AbstractArchiveTask.destinationDir property has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use the destinationDirectory property instead. See https://docs.gradle.org/6.7/dsl/org.gradle.api.tasks.bundling.AbstractArchiveTask.html#org.gradle.api.tasks.bundling.AbstractArchiveTask:destinationDir for more details.
    at FlutterPlugin$_addFlutterTasks_closure21$_closure47.doCall(/home/sudipta/snap/flutter/common/flutter/packages/flutter_tools/gradle/flutter.gradle:863)
    (Run with --stacktrace to get the full stack trace of this deprecation warning.)
The AbstractArchiveTask.archiveName property has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use the archiveFileName property instead. See https://docs.gradle.org/6.7/dsl/org.gradle.api.tasks.bundling.AbstractArchiveTask.html#org.gradle.api.tasks.bundling.AbstractArchiveTask:archiveName for more details.
    at FlutterPlugin$_addFlutterTasks_closure21$_closure47.doCall(/home/sudipta/snap/flutter/common/flutter/packages/flutter_tools/gradle/flutter.gradle:864)
    (Run with --stacktrace to get the full stack trace of this deprecation warning.)

> Configure project :system_alert_window
WARNING: The option setting 'android.enableR8=true' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8

> Task :help

Welcome to Gradle 6.7.

To run a build, run gradlew <task> ...

To see a list of available tasks, run gradlew tasks

To see a list of command-line options, run gradlew --help

To see more detail about a task, run gradlew help --task <task>

For troubleshooting, visit https://help.gradle.org

The last warning is due to system_alert_window (flutter)plugin that I am using. But these deprecation warnings are causing issues in Android Studio editor so that I am unable to use code completion feature. I don't know why is this happening, since these are only warning messages.

My gradle version is 6.7 and android-gradle version is 4.1.0.

Can anyone please help?

Sudipta Roy
  • 740
  • 1
  • 9
  • 29

1 Answers1

0

TRY this steps-

Step 1:

Open the gradle.properties file same like given Image-

https://i.stack.imgur.com/S2Y0a.png

Step 2:

Disable android.enableR8=true by adding a # in front:

#android.enableR8=true

Alternatively, you can swap out the R8 for D8, The build system changed to using D8 instead of R8.

android.enableD8=true
Sandesh Khutal
  • 1,712
  • 1
  • 4
  • 17
  • This is from system_alart_window plugin that I am using. I have force commented this line in gradle.properties file. The third warning is solved. But the first two is from flutter itself – Sudipta Roy Apr 29 '22 at 09:22
  • I fail to understand why these warning messages cause problems. It’s just saying that in future version of gradle, this will be deprecated – Sudipta Roy Apr 29 '22 at 09:27
  • Are you using any SYSTEM_ALERT_WINDOW in your app? – Sandesh Khutal Apr 29 '22 at 09:30
  • Yes, it’s a flutter plugin – Sudipta Roy Apr 29 '22 at 09:33
  • Then may be this will help you for that alerts warning after lollipop version need to change permission-https://stackoverflow.com/questions/33172390/how-to-handle-system-alert-window-permission-not-being-auto-granted-on-some-pre – Sandesh Khutal Apr 29 '22 at 09:38
  • The aforemntioned link was not very useful. Thanks anyway – Sudipta Roy May 02 '22 at 04:40
  • Please note that using `android.enableD8=true` has no effect, and has not had for [4 years since D8 became the default dexer](https://android-developers.googleblog.com/2018/04/android-studio-switching-to-d8-dexer.html), and will **not** _swap out the R8 for D8_. – sgjesse May 02 '22 at 06:37