question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't build when renaming apk

See original GitHub issue

Hi,

I got issue with version >= 8.0.0. No problem with version 0.7.3

Error:A problem was found with the configuration of task ':mymodulename:countDebugDexMethods'.
> File '/my/project/full/path/build/outputs/apk/debug/mymodulename-debug.apk' specified for property 'inputFile' does not exist.

The problem is that I rename the final apk like this (in “mymodulename” build.gradle):

[...]

android {
    [...]
    android.applicationVariants.all { variant ->
        variant.outputs.all {
            outputFileName = "mymodulename-${variant.name}-${variant.versionName}-${getGitHash()}.apk"
        }
    }
    [...]
}

[...]

I’ve found this somewhere on github or strackoverflow, don’t remember. Maybe I’m doing it wrong.

Last part of build with --stacktrace option:

[...]
:mymodulename:transformResourcesWithMergeJavaResForDebug
:mymodulename:packageDebug
:mymodulename:countDebugDexMethods FAILED

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':mymodulename:countDebugDexMethods'.
> File '/my/project/full/path/build/outputs/apk/debug/mymodulename-debug.apk' specified for property 'inputFile' does not exist.


* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskValidationException: A problem was found with the configuration of task ':mymodulename:countDebugDexMethods'.
	at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:55)
	at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
	at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
	at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:124)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:80)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:105)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:99)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.api.InvalidUserDataException: File '/my/project/full/path/build/outputs/apk/debug/mymodulename-debug.apk' specified for property 'inputFile' does not exist.
	at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:47)
	... 23 more

Thanks for your help (and thanks for your plugin!),

Regards.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
dkeresztescommented, Nov 9, 2017

@benjamin-bader Are you planning to release a new version with this fix in the near future?

5reactions
benjamin-badercommented, Oct 26, 2017

Sorry to have let this sit for so long! To be frank, the constant churn around this particular part of the Android Gradle Plugin has been pretty demotivating for me. Now that Studio 3.0 is out of beta and is officially released, I feel a little better about investigating its current behavior and fixing this plugin to match.

No timeline, but I’m still here!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't Generate Signed APK after renaming Package
1 Answer 1 · 1 ) close your studio · 2 ) go to the Project_Name\Module_Name\build\outputs\apk\ · 3 ) delete that apk ·...
Read more >
Release script is not able to signe a renamed apk file. #1279
The problem is, your signing script looks for the generic apk name. If I am not changing the name of the apk file...
Read more >
Building for Android - Unity - Manual
For example, Google Play requires your application to be an Android App Bundle (AAB) and not an APK. If you are targeting a...
Read more >
Shrink, obfuscate, and optimize your app - Android Developers
If your debug symbols footprint is too large, use SYMBOL_TABLE instead of FULL to decrease the file size. If your project builds an...
Read more >
APK File (What It Is and How to Open One) - Lifewire
You can't open or install APK files on an iPhone or iPad because the file is built in an entirely different manner than...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found