执行失败的任务':app:mapdebugsourcesetths'。 >评估属性的错误' extrageneratedResdir'任务
我已经检查了这个答案:
https://stackoverflow.com/a/34834772/13519865
apply plugin: 'com.google.gms.google-services'
构建,但我无法使用firebase(OFC!),它导致了一个新的错误,这告诉我添加该行: https://stackoverflow.com/a/40085096/13519865
所以,我在这里挂在这里。 相关代码示例此处添加 https://github.com/cyberavater/a.reader
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(26)
此问题在更新
com.android.tools.build:Gradle
7.3.0 后开始,并在更新com.google.gms后为我修复了
。 :Google-Services 到版本4.3.14
。This issue started after updating the
com.android.tools.build:gradle
to version7.3.0
and was fixed for me after updating thecom.google.gms:google-services
to version4.3.14
.编辑: 2024年4月15日,
同一问题似乎出现在最新您需要指定Gradle版本为
8.3.2
和Google Services4.4.1
。因此,这里是工作版本:编辑: 10月16日,2023年,
同一问题似乎出现在最新的 Android Studio Electric长颈鹿2022.3.1补丁3 您需要在其中指定Gradle版本为
8.1.3
和Google Services Services4.4.4.0
。我试图查看5.0.0
版本是否有效,但我得到了:因此,这里是工作版本:
edit: edit: 8月15日,2023年8月15日,
同样的问题似乎出现在最新的 android studio electric electric electric electric giraffe 您需要在哪里指定Gradle版本为
8.1.0
和Google Services4.3.15
。如果与5.0.0
一起使用,则没有测试。编辑: 2023年3月24日,
同一问题似乎出现在最新您需要在哪里指定Gradle版本为
7.4.0
和Google Services4.3.15
。编辑: 2023年1月4日,
我看到了最新的 android Studio Dolphin 发行,您需要在其中指定Gradle版本为
7.3.1
和Google Services4.3.14
。根据新的 chipmunk 如果您需要使用Google服务,则必须在您的build.gradle(project)文件中添加以下代码行:
Edit: April 15rd, 2024
The same issue seems to appear with the latest Android Studio Iguana | 2023.2.1 where you need to specify the Gradle version to be
8.3.2
and Google Services4.4.1
. So here are the working versions:Edit: October 16rd, 2023
The same issue seems to appear with the latest Android Studio Electric Giraffe 2022.3.1 Patch 3 where you need to specify the Gradle version to be
8.1.3
and Google Services4.4.0
. I have tried to see if the5.0.0
version works but I got:So here are the working versions:
Edit: August 15rd, 2023
The same issue seems to appear with the latest Android Studio Electric Giraffe where you need to specify the Gradle version to be
8.1.0
and Google Services4.3.15
. I have not tested if it's working with5.0.0
.Edit: March 24rd, 2023
The same issue seems to appear with the latest Android Studio Electric Eel where you need to specify the Gradle version to be
7.4.0
and Google Services4.3.15
.Edit: January 4th, 2023
I have seen the same issue with the latest Android Studio Dolphin release, where you need to specify the Gradle version to be
7.3.1
and Google Services4.3.14
.According to the new Chipmunk update of Android Studio, if you need to use Google Services, you have to add the following lines of code inside your build.gradle (Project) file:
And inside your build.gradle (Module) file, the following plugin IDs:
在>>中更改此行android/
build.gradle
change this line in >> android/build.gradle
to
2023年:这对我有用。
从
到
2023: This worked for me.
from
To
打开您的android文件夹,然后构建。gradle并找到
并最终更改
classpath'com.google.gms.gms:Google-Services:4.3.10'
toclass> class> classpath'com.google.gms.gms:google--服务:4.3.15'
现在您的代码应该看起来像
希望这会有所帮助
Open your android folder then build.gradle and find
and finally change
classpath 'com.google.gms:google-services:4.3.10'
toclasspath 'com.google.gms:google-services:4.3.15'
and your code should now look like
Hopefully this helps
对于像我这样的新手,逐步说明:
转到'android/build.gradle'
查找依赖项{}
替换那里
classpath'com.google.gms:Google-Services:4.3.10'
和
classPath'com.google.gms:Google-Services:4.3.14'
重建。
应该工作。
出于搜索目的的完整错误文本:
在调试模式下在SDK GPHONE64 ARM64上启动lib/main
。
执行失败的任务':app:mapdebugsourcesetths'。
在
例外:Gradle任务汇编失败,出口代码1
退出
For newbies like myself step by step instructions:
Go to 'android/build.gradle'
Find dependencies {}
Replace there the
classpath 'com.google.gms:google-services:4.3.10'
with
classpath 'com.google.gms:google-services:4.3.14'
Rebuild.
Should work.
The full error text for the search purpose:
Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
FAILURE: Build failed with an exception.
Execution failed for task ':app:mapDebugSourceSetPaths'.
BUILD FAILED in 3s
Exception: Gradle task assembleDebug failed with exit code 1
Exited
我面临着同样的问题,但是在更新了依赖性之后,问题得到了解决。
在我的项目级别的Gradle文件中,如下所示:
在下面更新后,它对我正常工作。
I was facing the same issues but after updating the dependency the issues were resolved.
in my project level Gradle file previous it was as below:
after updating as below, It was working fine with me.
我使用此链接使用最新的Google Services插件来解决:
https://developers.google.com/android.com/android/guides/google/google -Services-Plugin?hl = tr
现在链接提供这样的链接
I fixed with using latest google services plugin from this link:
https://developers.google.com/android/guides/google-services-plugin?hl=tr
right now link provides like this
在我的flutter项目的Android/build.gradle中,我进行了:
我通过将行更改为更新
,并解决了错误。自从我安装了最新版本的Flutter以来,当我将Flutter Project转移到新的笔记本电脑和Java版本中时,这发生了。
In my android/build.gradle for my Flutter project, I had:
I updated by changing the lines to
And the errors were resolved. This happened when I moved my Flutter project to a new laptop and the gradle to java versions no longer matched up since I installed the newest version of Flutter.
如果亚历克斯·马莫(Alex Mamo)的答案不能为您解决问题,请阅读此内容。
Android Studio的新更新优先级或更喜欢设置。有两种可能的解决方案。
解决方案1。如下更新现有项目。
更新您的设置.gradle
更新您的build.gradle(project)。使用您的Gradle版本,此示例使用版本7.3.0和Google-Services:4.3.14。
将其添加到您的build.gradle(App)
解决方案2。您可以创建一个新项目,并将所有类并将XML移至新项目中。
Read this if Alex Mamo's answer does not solve the problem for you.
The new updates of Android Studio prioritize or prefer the settings.gradle file above build.gradle(project) for plugin management. There are two possible solutions.
Solution 1. Update your existing project as follows.
Update your settings.gradle
Update your build.gradle(project). Use your Gradle version, this example uses version 7.3.0, and google-services: 4.3.14.
Add this to your build.gradle(app)
Solution 2. You can create a new project and move all your classes and XML into the new project.
已解决的
替换classpath'com.google.gms:Google-Services:4.3.10'with classpath'com.google.gms.gms:Google-Services:4.3.14'在Android/build.gradle中
检查最新的GS在这里:
https://developers.google.com/android/guides/google-services-插件
solved
Replace classpath 'com.google.gms:google-services:4.3.10' with classpath 'com.google.gms:google-services:4.3.14' in android/build.gradle
check the latest gs here :
https://developers.google.com/android/guides/google-services-plugin
只需更新您
com.google.gms:Google-Services
到最新版本。Just update you
com.google.gms:google-services
to latest version.更新
classPath'com.google.gms:Google-Services'
最新版本为我解决了错误。Updating
classpath 'com.google.gms:google-services'
to the latest version solved the error for me.我在Android Studio 2022.3.1中遇到了同样的错误。
通过打开Android/build.gradle并将构建Gradle版本升级到7.3.1,将Google Services版本升级到4.3.15,
I encountered same error in Android Studio Giraffe 2022.3.1
By opening android/build.gradle and upgrading the build gradle version to 7.3.1 and Google services version to 4.3.15 my app worked.
对于Cordova-Builds:我缺少config.xml中的以下属性:
&lt; preference name =“ gradlePlugingOogleServicesEnabled” value =“ true” /&gt; < /code>
config.xml中您还可以设置GoogleServices版本(如果您想在Cordova项目中应用其他用户的答案,而无需提交平台或插件目录):
&lt; preference name =“ gradleplugingoogleservicesversion” value =“ 4.3.15” /&gt; < /code>
For Cordova-Builds: I was missing the following attribute in the config.xml:
<preference name="GradlePluginGoogleServicesEnabled" value="true" />
In the config.xml you can also set the googleServices version (if you want to apply the answers of the other users in a cordova project without commiting the platforms or plugin directory):
<preference name="GradlePluginGoogleServicesVersion" value="4.3.15" />
这对我有用:
在 android \ build.gradle
in android \ app \ build.gradle 中
This worked for me:
In android\build.gradle
In android\app\build.gradle
在&gt;&gt;中更改此行您的项目/android/build.gradle
到
change this line in >> Your project/android/build.gradle
to
转到此链接 https://developers.google.com/andandroid/guides/guides/guides/ Google-Services-Plugin 。在
中,Android/build.gradle
使用该页面中显示的版本代替&lt;最新版本&gt;
在以下。Go to this link https://developers.google.com/android/guides/google-services-plugin. In
android/build.gradle
use the version displayed in that page in place of<latest-version>
in the following.尝试删除.idea和.gradle文件夹,然后从应用程序的root中,然后是从主应用程序模块中... Android Studio Dolphin中的Bug,我用克隆与新项目的克隆一起解决了它
Try with deleting .idea and .gradle folders from root of your app , an then from main app module ... If this doesn't work , then you must clone your project, making new one with same package name ... This is bug in Android Studio Dolphin , and I solved it with cloning with new project with same package name
首先检查您的build.gradle(项目),并在插件下方粘贴这些代码,并同步您的项目。
First check your build.gradle(project) and paste these code below the plugins and also sync your project.
就我而言,问题涉及app/build.gradle,我倾向于设置三个值:(1)compilesdkversion,(2)minsdkversion和(3)Targetsdkversion。
在这种情况下,我发现自己设置了四个值,因为Android Studio的新版本为我提供了选择,但是我感到困惑,将“第四”值与通常的三个值之一混合在一起,但事实证明第四个值是不应该触摸的人,如果您对其进行修改,那么您将四处逛逛,以寻找一种解决永无止境的错误消息的方法 - 因此,我遇到了这篇文章。
示例
如果您在应用程序/build.gradle文件中看到上述内容,请不要修改它,如果您对其进行了修改,请复制您在此处看到的内容或还原为默认值。设置正确的位置后,错误就会消失并颤动运行(如果您为通常的三个设置设置了正确的设置)。
如果此答案对您有所帮助,请记住勾选它,以便它也可以帮助他人。
In my case, the problem concerned the app/build.gradle where I tend to set three values: (1) compileSdkVersion, (2) minSdkVersion and (3) targetSdkVersion.
On this occasion I found myself setting four values, because a newer version of Android Studio has given me the option, but I was confused, mixing up the "fourth" value with one of the usual three, but it turns out that the fourth value is one that shouldn't be touched, and if you amend it then you'll go around in circles searching for a way to fix the never-ending error messages - hence my encounter with this post.
Example
If you see the above within your app/build.gradle file, do not amend it, and if you have amended it, copy what you see here or revert to the default values. Once you set this bit right the error goes away and Flutter runs (if you have set the right settings for the usual three settings).
If this answer helps you, remember to tick it so that it can help others as well.
在flutter-&gt;
android/build.gradle
In Flutter ->
Android/build.gradle
转到Android/buil.gradle
用以下代码替换与依赖关系相关的代码:
Go to Android/buil.gradle
replace your dependencies-related code with the following code:
首先,将此行从您的build.gradle文件和所有相关文件中删除使用Google Play服务(AD,Firebase等...),
然后在您的应用级别build.gradle文件中删除此行,
您必须删除与Google Play服务相关的所有文件。 ..
First delete this lines from your build.gradle file and all related files with google play services ( ads , firebase etc ...)
Then in your app level build.gradle file delete this lines
You must delete all files related to google play service ...
在我的扑波项目中,我解决了以下方法:
android/build.gradle
依赖项{
classpath'com.android.tool.tool.tools.builds.build:7.3.0 '
classPath'com.google.gms:Google-Services:4.3.14'
classpath'org.jetbrains.kotlin.kotlin:kotlin-gradle-plugin:$ kotlin_version”代码>
}
在终端上
flutter Pub获取
In my Flutter project I solved this by:
android/build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath 'com.google.gms:google-services:4.3.14'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
on terminal
flutter clean
flutter pub get
这很可能是版本不兼容的问题。尝试为您的AGP(Android Gradle插件)找到兼容的Google-Services Gradle插件版本或降级AGP。
选定的答案(几乎经常定期)使用兼容对。
可悲的是,他们没有提供兼容性矩阵,我只能找到它: https://github.com/google/google/play-services-services-plugins/tree/tree/master/google-services-services-services-plugin-plugin-plugin-plugin-vandroid-gandroid-gladle-gradle-plugin-plugin-compatibility
This is most likely a version incompatibility issue. Try to find the compatible google-services Gradle plugin version for your AGP (Android Gradle Plugin) or downgrade your AGP.
The selected answer is updated (almost regularly) with a compatible pair.
Sadly they don't provide a compatibility matrix and I was only able to find this: https://github.com/google/play-services-plugins/tree/master/google-services-plugin#android-gradle-plugin-compatibility