1

Trying to Build the android APK for a flutter app and these bugs keeps coming up

FAILURE: Build failed with an exception.



* What went wrong:

Execution failed for task ':app:transformClassesAndResourcesWithR8ForRelease'.

> com.android.tools.r8.CompilationFailedException: Compilation failed to complete



* 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 22m 24s
Running Gradle task 'assembleRelease'...                         1358.6s (!)
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin agora_rtc_engine...
Running Gradle task 'assembleAarRelease'...                      1096.7s (!)
Downloading https://services.gradle.org/distributions/gradle-4.6-all.zip

........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'agora_rtc_engine'.
Unzipping C:\Users\me\.gradle\wrapper\dists\gradle-4.6-all\bcst21l2brirad8k2ben1letg\gradle-4.6-all.zip to C:\Users\me\.gradle\wrapper\dists\gradle-4.6-all\bcst21l2brirad8k2ben1letg
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

WARNING: The option setting 'android.enableR8=true' is experimental and unsupported.
* Try:
The current default is 'false'
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.
Consider disabling R8 by removing 'android.enableR8=true' from your gradle.properties before publishing your app.


* Get more help at https://help.gradle.org

BUILD FAILED in 18m 12s

The plugin agora_rtc_engine could not be built due to the issue above.

When I run the code, it works fine. So I am assuming that the problem is not with the code. so what can be wrong that makes it unable to build apk

Formally the sdk directory was like this sdk.dir=C:\\Users\\me\\AppData\\Local\\Android\\Sdk but then I changed it to what is below by the inclusion of "\" in front of the "C" the Flutter build APK is not responding

Here is my local.properties

sdk.dir=C\:\\Users\\me\\AppData\\Local\\Android\\Sdk
flutter.sdk=C\:\\src\\flutter
flutter.buildMode=release
flutter.versionName=1.0.0
flutter.versionCode=1

Here is my settings.gradle

include ':app'

def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()

def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
    pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}

plugins.each { name, path ->
    def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
    include ":$name"
    project(":$name").projectDir = pluginDirectory
}

Now when I Click the the Build APK, the Android studio is not responding(i.e trying to build the APK) and when it does try to build APK its brings out these bugs, I have checked the questions that looks similar to this and tried the solutions which is sdk.dir but the bug still remained unfixed

wizsab
  • 45
  • 2
  • 8

0 Answers0