flutter:从flutter应用程序构建apk失败



我正试图从我的flutter应用程序构建apk,但我遇到了这个错误:

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        

我在谷歌上搜索了一下,发现compileSdkVersion必须是28。这是我的构建渐变应用程序:

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
}
}
}

但我还是犯了错误?

您尚未接受某些android许可证。请正确读取扑动医生输出并运行flutter doctor --android-licenses

编辑:

另外,你似乎没有linux的库。

On Debian/Ubuntu/Mint: sudo apt-get install lib32stdc++6
On Fedora: dnf install libstdc++.i686
On Arch: pacman -S lib32-gcc-libs

最新更新