iis服务器助手广告
返回顶部
首页 > 资讯 > 移动开发 >No signature of method: build_*.android() is applicable for argument types
  • 150
分享到

No signature of method: build_*.android() is applicable for argument types

android 2023-09-06 16:09:20 150人浏览 八月长安
摘要

意思很直观:就是build的时候,Android()的参数错误。 更新android studio 后出现这种问题,主要是新版本的生成的app和module模版有所变化引起的。 Android S

意思很直观:就是build的时候,Android()的参数错误。
更新android studio 后出现这种问题,主要是新版本的生成的app和module模版有所变化引起的。

Android Studio Electric Eel | 2022.1.1 Patch 1
Build #ai-221.6008.13.2211.9514443, built on January 21, 2023
Runtime version: 11.0.15+0-b2043.56-8887301 x86_64
VM: Openjdk 64-Bit Server VM by JetBrains s.r.o.
MacOS 12.6.3
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 4
ReGIStry:
external.system.auto.import.disabled=true
ide.text.editor.with.preview.show.floating.toolbar=false
ide.instant.shutdown=false

根据如下几点快速匹配尝试处理:

1、build.gradle 中apply plugin 变化

apply plugin: ‘com.android.application’ 变化为

plugins {    id 'com.android.application'}

2、android括号里面的配置项名称变化

一般情况是没有了’Version’字样,例如compileSdkVersion 变成了compileSdk

android {//    namespace 'com.eagle.chatgpt'    compileSdk 29    buildToolsVersion '30.0.1'    defaultConfig {        applicationId "com.eagle.chatgpt"        minSdkVersion 24        targetSdkVersion 28        versionCode 1        versionName "1.0"    }

在这里插入图片描述

3、manifest中package变成namespace并移到了build.gradle中

在这里插入图片描述
同时这build.gradle中android节点中多了namespace参数
在这里插入图片描述
此时如果将gradle版本号降低,那么就出现了如题的问题,gradle版本号为低于7.4.1时就android() 是没有namespace参数的,此时将namespace去处,同时这manifest中添加package属性就正常了。

4、原始办法-注释法

根据报错信息(行号)我们很容易找到android位置,将其中的属性都注释掉,一行行放开。哪个错再对应具体查找基本可以解决。

来源地址:https://blog.csdn.net/lanlangaogao/article/details/129023270

--结束END--

本文标题: No signature of method: build_*.android() is applicable for argument types

本文链接: https://www.lsjlt.com/news/397235.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作