Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle sync failed: No signature of method: com.android.build.gradle.internal.scope.VariantScopeImpl.getMergeAssetsTask() is applicable for argument types: () values: [] #640

Open
shawnlinboy opened this issue Aug 15, 2018 · 14 comments

Comments

@shawnlinboy
Copy link
Contributor

问题详细描述 Detailed description of the problem

复现问题步骤 Steps to reproduce the problem

  1. Followed as https://github.com/Qihoo360/RePlugin/wiki/%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B

其它重要信息 Other important information

classpath 'com.android.tools.build:gradle:3.2.0-beta05'
classpath 'com.qihoo360.replugin:replugin-host-gradle:2.2.4'

implementation 'com.qihoo360.replugin:replugin-host-lib:2.2.4'

gradle version 4.6

Android API Version:27

@shawnlinboy
Copy link
Contributor Author

classpath 'com.android.tools.build:gradle:3.1.4 will be fine. Please dig into this problem.

@shawnlinboy
Copy link
Contributor Author

@seventhmoon Thanks for your information, hope the 360 Official can solve this as soon as possible 👍

@a562536056
Copy link

希望360官方能够快点解决这个问题,现在项目提示gradle mininum supported gradle version是4.6
而replugin又在4.6上有这个问题。死胡同了。

@perqin
Copy link

perqin commented Sep 8, 2018

I encounter this problem too. As @shawnlinboy said, using com.android.tools.build:gradle:3.1.4 solve it temporarily. However I am using AndroidX and Jetifier (which helps replacing 3rd party libraries' dependency on legacy support library). Jetifier on this gradle plugin version has some bug. In detail:

  • gradle plugin 3.1.4 + AndroidX + Tencent Map SDK: Program type already present: android.support.v4.os.ResultReceiver$1 exception, because Tencent Map SDK depends on support-v4 and Jetifier doesn't handle it properly.

  • gradle plugin 3.3.0-alpha08 + AndroidX + Tencent Map SDK: No signature of method exception

Hope that RePlugin team could fix it soon.

perqin added a commit to perqin/RePlugin that referenced this issue Sep 9, 2018
This commit fixes Gradle Sync failure when using Android Gradle plugin
in preview channel (include 3.3.0-alpha08). The detailed problem is
described in issue Qihoo360#640.
@perqin
Copy link

perqin commented Sep 9, 2018

Hi all. I've dug into the stack trace slightly and tried patching it.

Where's the patched plugin?

Here.

How to use it?

Download the .jar file from the link above, and place it into somewhere of your Android project (for example yourAwesomeApp/replugin-lib/patched-plugin.jar). Then modify your project's build.gradle from:

classpath 'com.qihoo360.replugin:replugin-host-gradle:2.3.0'

to:

classpath fileTree(dir: 'replugin-lib', include: ['*.jar'])

And sync the project now.

Disclaimer

  • The fix is patched over the latest dev branch.

  • The patch isn't fully tested (well, actually it is only tested over a HelloWorld project).

  • Since the API of the Android Gradle plugin may still be changed frequently during the alpha phase, this patch is not 100% reliable and may be broken someday. You'd better be patient and wait for official fix after the next stable Android Gradle plugin is released. Use this patch at your own risk.

@Light-DNA
Copy link

Light-DNA commented Sep 11, 2018

上面原因是
classpath 'com.android.tools.build:gradle:3.2.0-beta05'
强制使用4.6的gradle,现在插件还没兼容4.6,只能退后些。希望能尽快解决
我遇的问题,不过是因为用了
classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT'
现在是暂时退回使用classpath 'com.android.tools.build:gradle:3.1.4'
可以一个个排除
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2'
classpath 'com.qihoo360.replugin:replugin-host-gradle:2.2.4'
//classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT'
classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1'
}

@sunshinehu
Copy link

也遇到了这个问题,希望官方可以解决

@wanliLiu
Copy link

问题详细描述 Detailed description of the problem

复现问题步骤 Steps to reproduce the problem

  1. Followed as https://github.com/Qihoo360/RePlugin/wiki/%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B

其它重要信息 Other important information

classpath 'com.android.tools.build:gradle:3.2.0-beta05'
classpath 'com.qihoo360.replugin:replugin-host-gradle:2.2.4'

implementation 'com.qihoo360.replugin:replugin-host-lib:2.2.4'

gradle version 4.6

Android API Version:27

Android build tool gradle 3.2.0做了相关调整,修改项目中的:
1.
variant.getVariantData().getScope().getGenerateBuildConfigTask().name
为:
variant.getVariantData().getTaskContainer().getGenerateBuildConfigTask().name

2.variant.getVariantData().getScope().getMergeAssetsTask().name

variant.getVariantData().getTaskContainer().getMergeAssetsTask().name

就可以了,可以用我自己的地址
maven{url "https://dl.bintray.com/soli/maven"}

然后所有的版本改成:2.3.1就可以用了

@xiazunyang
Copy link

xiazunyang commented Oct 12, 2018

可以用我自己的地址

maven{url "https://dl.bintray.com/soli/maven"}

然后所有的版本改成:2.3.1就可以用了

非常感谢!!!解决了这个BUG!!!我已经在我的项目中使用你的方法!

@yufan2014
Copy link

可以用我自己的地址

maven{url "https://dl.bintray.com/soli/maven"}
然后所有的版本改成:2.3.1就可以用了

非常感谢!!!解决了这个BUG!!!我已经在我的项目中使用你的方法!

dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
}

distributionUrl=https://services.gradle.org/distributions/gradle-4.5-all.zip

@huanglongyu
Copy link

so, how is this issue going?

@deiven1993
Copy link

Hi all. I've dug into the stack trace slightly and tried patching it.

Where's the patched plugin?

Here.

How to use it?

Download the .jar file from the link above, and place it into somewhere of your Android project (for example yourAwesomeApp/replugin-lib/patched-plugin.jar). Then modify your project's build.gradle from:

classpath 'com.qihoo360.replugin:replugin-host-gradle:2.3.0'

to:

classpath fileTree(dir: 'replugin-lib', include: ['*.jar'])

And sync the project now.

Disclaimer

  • The fix is patched over the latest dev branch.
  • The patch isn't fully tested (well, actually it is only tested over a HelloWorld project).
  • Since the API of the Android Gradle plugin may still be changed frequently during the alpha phase, this patch is not 100% reliable and may be broken someday. You'd better be patient and wait for official fix after the next stable Android Gradle plugin is released. Use this patch at your own risk.

有效,非常感谢

@wangxp423
Copy link

Hi all. I've dug into the stack trace slightly and tried patching it.

Where's the patched plugin?

Here.

How to use it?

Download the .jar file from the link above, and place it into somewhere of your Android project (for example yourAwesomeApp/replugin-lib/patched-plugin.jar). Then modify your project's build.gradle from:

classpath 'com.qihoo360.replugin:replugin-host-gradle:2.3.0'

to:

classpath fileTree(dir: 'replugin-lib', include: ['*.jar'])

And sync the project now.

Disclaimer

  • The fix is patched over the latest dev branch.
  • The patch isn't fully tested (well, actually it is only tested over a HelloWorld project).
  • Since the API of the Android Gradle plugin may still be changed frequently during the alpha phase, this patch is not 100% reliable and may be broken someday. You'd better be patient and wait for official fix after the next stable Android Gradle plugin is released. Use this patch at your own risk.

Hi all. I've dug into the stack trace slightly and tried patching it.

Where's the patched plugin?

Here.

How to use it?

Download the .jar file from the link above, and place it into somewhere of your Android project (for example yourAwesomeApp/replugin-lib/patched-plugin.jar). Then modify your project's build.gradle from:

classpath 'com.qihoo360.replugin:replugin-host-gradle:2.3.0'

to:

classpath fileTree(dir: 'replugin-lib', include: ['*.jar'])

And sync the project now.

Disclaimer

  • The fix is patched over the latest dev branch.
  • The patch isn't fully tested (well, actually it is only tested over a HelloWorld project).
  • Since the API of the Android Gradle plugin may still be changed frequently during the alpha phase, this patch is not 100% reliable and may be broken someday. You'd better be patient and wait for official fix after the next stable Android Gradle plugin is released. Use this patch at your own risk.

下载jar包试了一下。仍然报这个异常。不能编译通过。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests