我在运行flutter应用程序时遇到此错误。
执行 com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction 时失败 依赖项的 AAR 元数据 (META-INF/com/android/build/gradle/aar-metadata.properties) 中指定的 minCompileSdk (31) 大于此模块的 compileSdkVersion (android-30)。依赖:androidx.work:work-runtime:2.7.0-rc01。AAR 元数据文件: C:\Users\HP.gradle\caches\transforms-2\files-2.1\8fcba37f766c3622d8dbd30df4e98577\work-runtime-2.7.0-rc01\META-INF\com\android\build\gradle\aar-metadata.properties.
>
尝试:使用--stacktrac选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获得更多日志输出。使用--扫描运行以获得完整的见解。
在 https://help.gradle.org 获取更多帮助
8s内构建失败异常:Gradle任务汇编调试失败,退出代码为1
下面是我的Android清单文件
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.owaslo.sukithasagayo.caregiver">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:label="Sukitha Sagayo Member"
android:icon="@mipmap/launcher_icon">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
下面是我的app/build.gradle文件
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location
with flutter.sdk in the local.properties file.")
}
def flutterVersionCode =
localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName =
localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply from:
"$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
//Load the key.properties file into the keystoreProperties
object.
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new
FileInputStream(keystorePropertiesFile))
}
android {
compileSdkVersion 30
defaultConfig {
// TODO: Specify your own unique Application ID
(https://developer.android.com/studio/build/application-id.html).
applicationId "com.owaslo.sukithasagayo.caregiver"
minSdkVersion 19
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}
flutter {
source '../..'
}
请帮帮忙!!!
请分享您的< code>app/ build.gradle文件,您使用的是哪个sdk版本?似乎你使用的是30级的android api,而其中一个依赖项使用的是31级的android api。
我在运行我的应用程序时得到了这个错误。
我不能再发布我的应用程序了。我使用的是AndroidStudio 4.0和FlatterSDK版本1.17。5.上个月我已经发布了两次我的应用程序,但现在我真的不知道错误的原因是什么。当我在终端中键入时,会出现以下错误:
null 请访问https://help.gradle.org获取更多帮助 生成在3M 12s中失败异常:Gradle task assembleDebug失败,退出代码为%1
我最近回到了我以前的flutter项目,更新了一大堆东西,因为我得到了错误。现在我得到了下面的错误。我已经在上面至少3天了,尝试了一堆不同的东西,但我似乎仍然找不到解决办法。任何帮助都非常感谢。我还包含了下面的文件: 下面是我的: 这是我的:
尝试在我的项目中使用FiRecovery。我的项目是一个全新的项目,但在我的设备上运行应用程序时遇到问题而没有收到错误:任务“: app: mergeDexDebug”执行失败。 我的应用程序正在使用AndroidX。我已经添加了我的谷歌服务。json文件,遵循步骤等。 Yaml文件: android/build。格拉德尔: 完全错误: 失败:构建失败,但有例外。 错误:任务:app:mergeD
错误:任务执行失败 ': app:使用合并Java Res For Debug转换资源'。 com.android.build.api.transform.TransformException:com.android.builder.packaging.DuplicateFileException: APK META-INF/LICENSE File1中复制的重复文件: C:\用户Jithin-P