0

I am trying to build apk from my flutter app but i got this error :

Note: /mnt/Software/Linux/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.5/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.                    
Note: Some input files use or override a deprecated API.                
Note: Recompile with -Xlint:deprecation for details.                    

FAILURE: Build failed with an exception.                                

* What went wrong:                                                      
Execution failed for task ':keyboard_visibility:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > 1 exception was raised by workers:                                 
     com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
     /home/tazik/.gradle/caches/transforms-2/files-2.1/4cfe0911440d16ca6e1ca90c791c61c2/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVariationSettings not found.

     /home/tazik/.gradle/caches/transforms-2/files-2.1/4cfe0911440d16ca6e1ca90c791c61c2/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/ttcIndex not found.



* 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        

I googled and i find that compileSdkVersion must be 28. This is my build gradle app:

android {
    compileSdkVersion 28

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "net.mobile"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    signingConfigs {
        release {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
            storePassword keystoreProperties['storePassword']
        }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
    }
}

But i still got error?

Cyrus the Great
  • 5,145
  • 5
  • 68
  • 149

1 Answers1

0

You haven't accepted some android licenses. Please read flutter doctor output properly and run flutter doctor --android-licenses

EDIT:

Also it seems you dont have libraries for linux.

On Debian/Ubuntu/Mint: sudo apt-get install lib32stdc++6

On Fedora: dnf install libstdc++.i686

On Arch: pacman -S lib32-gcc-libs