Strange gradle error Expected configuration (...) contains exactly one file but no files

I am trying to develop a simple instant application. I have done all the modules and configurations, but when I try to start instantly, the gradle console will show me the error below:

FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':blogspace-instant:packageDebugInstantAppBundle'. > Expected configuration ':blogspace-instant:debugCompileClasspath' to contain exactly one file, however, it contains no files. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. * Get more help at https://help.gradle.org BUILD FAILED in 1s 

Does anyone know how to solve this problem?

+8
source share
5 answers

Make sure you have baseFeature true in the base function defaultConfig.

If you don't have a base and only one function, put baseFeature true in your one function.

In older versions, an unnamed function was the base, but now you need to explicitly highlight it.

+9
source

In addition to what is mentioned in the accepted answer, I had to do one more thing to make it work. You must ensure that all of your functional modules are dependent on the base module.

Put this in the Gradle file of all function modules

 implementation project(':base') 
+1
source

If you see that the problem is related to the module of dynamic functions, make sure that it depends on the “base” module or on which module you used:

 apply plugin: 'com.android.application' 

as he will be responsible for creating the Android app.

When dynamic functions entered the game, the way the project was built changed. Prior to this, the application module included all library modules, but now dynamic function modules should include the application module as @ezio mentions:

fooobar.com/questions/1271162 / ...

+1
source

Make sure you add the function dependency to the InstantApp module.

This solution worked for me.

0
source

I am also facing the same issue with gradle 5.1 versions (distributionUrl = https://services.gradle.org/distributions/gradle-5.3-all.zip)

FAILURE: assembly failed, exception.

  • What went wrong: There was a problem setting up the root project 'performance-test-assetmanagement'.

    Failed to notify listener of project evaluation. org.gradle.api.tasks.TaskInputs.file (Ljava / languages ​​/ object;) Lorg / Gradle / API / tasks / TaskInputs; The expected output files of the bootRepackage task should contain exactly one file, however it does not contain files.

  • Try: Run with the --info or --debug option to get more log output. Run with --scan to get a complete view.

org.gradle.api.ProjectConfigurationException: There was a problem setting up the root project "project name". Reason: org.gradle.internal.event.ListenerNotificationException: Failed to notify the project evaluation listener. Called: java.lang.NoSuchMethodError: org.gradle.api.tasks.TaskInputs.file (Ljava / lang / Object;) Lorg / gradle / api / tasks / TaskInputs;

0
source

Source: https://habr.com/ru/post/1271162/


All Articles