You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.3.1). #23404
c: crashStack traces logged to the consolet: gradle"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.waiting for PR to land (fixed)A fix is in flight
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not resolve all artifacts for configuration 'classpath'.
> Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.3.1).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/aapt2-proto/0.3.1/aapt2-proto-0.3.1.jar
Reacted by NMateu, Hugo Extrat, Maksim Ryzhikov, IgorBelyayev, Jean-Marie PARENT, Erik Werner, Illia Achour, Pablo Henao Posada, Feu, Martin Staadecker and 12 more
Hi,
I've added google() inside the buildScript and also updated the gradle-wrapper properties distributionUrl to distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip.
change the buildScript from $flutterRoot/packages/flutter_tools/gradle/flutter.gradle file to
and the issue disappeared for me . try these if any one is facing the same issue.
Reacted by yxfmlbb, David Leibovych, AparnaTumu, Ajay Singh Dewari, Paul, Illia Achour, Florent Roques, sangjin.pyeon, Eros Zhao, Kyle Kaplan and 32 more
Reacted by Pareshkumar Patil, Álex Meseguer, Li Zebang, mohammedmutafa, leman.li, Rafael Beck, Phani Rithvij, Sanyam Jain, Yash Singh, mmgyce and 3 more
Reacted by ZX
Reacted by Nicolas Fierro, Philippe Parisot, Salvatore Michele Rago and Aleksandar Penev
Reacted by Shamsul Alam Rocky, [email protected], Philippe Parisot, Konoshenko Vlad, Omar Abdo, ZX, Aleksandar Penev and Sahand
@Mahi-K I get the following error, after add your suggestion.
* What went wrong:
Execution failed for task ':app:preDebugBuild'.
> Android dependency 'com.android.support:support-v4' has different version for the compile (26.1.0) and runtime (27.1.1) classpath. You should manually set the same version via DependencyResolution
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
Finished with error: Gradle task assembleDebug failed with exit code 1
@pepie sorry, for the delay, this can be solved by changing all your classpath dependencies to 27.1.1. just open your project in the android studio (rightclick on the root of your project and select open AndroidModule in Android Studio
) and change the classpath dependencies of all your packages to reflect 27.1.1. you can see all the gradle files for all the packages and the only option is to check each one and change to 27.1.1. Thanks
Reacted by AparnaTumu, Ramakrishnan and 韩小醋
Reacted by IceInTheFire and Mohammad Bagher Fakouri
But flutter does not search other repo's for aapt2, I haven't got a clue what aapt2 is, my best guess is something with the android build tools and somehow needed for gradle ?
But flutter does not search other repo's for aapt2, I haven't got a clue what aapt2 is, my best guess is something with the android build tools and somehow needed for gradle ?
You have to modify the <flutter_root>/packages/flutter_tools/gradle/flutter.gradle instead. See this commit for a reference: e93d19c
Reacted by Daniel Carroll, David Leibovych, batyanko and Philippe Parisot
But flutter does not search other repo's for aapt2, I haven't got a clue what aapt2 is, my best guess is something with the android build tools and somehow needed for gradle ?
You have to modify the <flutter_root>/packages/flutter_tools/gradle/flutter.gradle instead. See this commit for a reference: e93d19c
Yes,it's ok. But there is another problem.
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:flutterBuildDynamicRelease'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
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:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
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:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.process.internal.ExecException: Process 'command 'D:\git\flutter\bin\flutter.bat'' finished with non-zero exit value 1
at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:382)
at org.gradle.process.internal.DefaultExecAction.execute(DefaultExecAction.java:31)
at org.gradle.api.internal.file.DefaultFileOperations.exec(DefaultFileOperations.java:188)
at org.gradle.api.internal.project.DefaultProject.exec(DefaultProject.java:1086)
at org.gradle.api.internal.project.DefaultProject.exec(DefaultProject.java:1081)
at org.gradle.api.Project$exec$6.call(Unknown Source)
at BaseFlutterTask.buildBundle(D:\git\flutter\packages\flutter_tools\gradle\flutter.gradle:495)
at BaseFlutterTask$buildBundle.callCurrent(Unknown Source)
at FlutterTask.build(D:\git\flutter\packages\flutter_tools\gradle\flutter.gradle:626)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:780)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:747)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
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:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
... 32 more
@SocialMammoth It's not necessary to make a PR, you could change maven repository by yourself. Because the mirror maven repository may not be fit for everyone.
I created issue #23810 for the problem that I am having because after testing the master channel on Intel CPUs it works fine, it looks my issue is separate to this one. The issue can only be recreated on AMD cpus it looks like (Ryzen only?). Thanks to everyone for trying to help out!
flutter run
Launching lib/main.dart on HUAWEI CAN L11 in debug mode...
Initializing gradle... ⢿
Oops; flutter has exited unexpectedly: "Exit code 1 from: /Users/admin/fir/android/gradlew -v:
Exception in thread "main" java.lang.RuntimeException: Could not load wrapper properties from '/Users/admin/fir/android/gradle/wrapper/gradle-wrapper.properties'.
at org.gradle.wrapper.WrapperExecutor.<init>(WrapperExecutor.java:64)
at org.gradle.wrapper.WrapperExecutor.forWrapperPropertiesFile(WrapperExecutor.java:47)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:60)
Caused by: java.net.URISyntaxException: Illegal character in scheme name at index 15: distributionUrl=https://services.gradle.org/distributions/gradle-4.6-all.zip
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.checkChars(URI.java:3021)
at java.net.URI$Parser.parse(URI.java:3048)
at java.net.URI.<init>(URI.java:588)
at org.gradle.wrapper.WrapperExecutor.readDistroUrl(WrapperExecutor.java:81)
at org.gradle.wrapper.WrapperExecutor.prepareDistributionUri(WrapperExecutor.java:70)
at org.gradle.wrapper.WrapperExecutor.<init>(WrapperExecutor.java:57)
... 2 more".
Sending crash report to Google.
Crash report sent (report ID: 1f0035529e3fa33a)
Crash report written to /Users/admin/fir/flutter_02.log;
please let us know at https://github.com/flutter/flutter/issues.
@mohammedmutafa I think this question is better asked on StackOverflow with the content of /Users/admin/fir/android/gradle/wrapper/gradle-wrapper.properties
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
c: crashStack traces logged to the consolet: gradle"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.waiting for PR to land (fixed)A fix is in flight
Activity
huextrat commentedon Oct 23, 2018
Same issue here ...
NMateu commentedon Oct 23, 2018
Should be resolved after merge #23397
Mahi-K commentedon Oct 23, 2018
Hi,
I've added
google()inside thebuildScriptand also updated the gradle-wrapper properties distributionUrl todistributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip.change the buildScript from
$flutterRoot/packages/flutter_tools/gradle/flutter.gradlefile toand the issue disappeared for me . try these if any one is facing the same issue.
fix(android): Could not find aapt2-proto.jar (com.android.tools.build…
alienfractal commentedon Oct 23, 2018
SAme issue here...
pepie commentedon Oct 23, 2018
@Mahi-K I get the following error, after add your suggestion.
Mahi-K commentedon Oct 23, 2018
@pepie sorry, for the delay, this can be solved by changing all your classpath dependencies to 27.1.1. just open your project in the android studio (rightclick on the root of your project and select open AndroidModule in Android Studio

) and change the classpath dependencies of all your packages to reflect 27.1.1. you can see all the gradle files for all the packages and the only option is to check each one and change to 27.1.1. Thanks
zoechi commentedon Oct 24, 2018
#22953, #23095, #23403 contains a similar error message.
MarcelEdward2 commentedon Oct 24, 2018
The error remains
adding google() or maven does not make the error go away.
The jar file does not seem to exist at the jcenter repo.
It can be found at this url:
https://maven.google.com/com/android/tools/build/aapt2-proto/0.3.1/aapt2-proto-0.3.1.jar
But flutter does not search other repo's for aapt2, I haven't got a clue what aapt2 is, my best guess is something with the android build tools and somehow needed for gradle ?
mrmitew commentedon Oct 24, 2018
You have to modify the
<flutter_root>/packages/flutter_tools/gradle/flutter.gradleinstead. See this commit for a reference: e93d19chschenzhimin commentedon Oct 24, 2018
Yes,it's ok. But there is another problem.
MarcelEdward2 commentedon Oct 24, 2018
yes that works, tnx @mrmitew
I think the maven {} part can be removed, it probably never gets there
20 remaining items
ChangJoo-Park commentedon Nov 1, 2018
+1
chuckiefan commentedon Nov 1, 2018
@SocialMammoth It's not necessary to make a PR, you could change maven repository by yourself. Because the mirror maven repository may not be fit for everyone.
PhilParisot commentedon Nov 1, 2018
I created issue #23810 for the problem that I am having because after testing the master channel on Intel CPUs it works fine, it looks my issue is separate to this one. The issue can only be recreated on AMD cpus it looks like (Ryzen only?). Thanks to everyone for trying to help out!
mohammedmutafa commentedon Nov 6, 2018
zoechi commentedon Nov 6, 2018
@mohammedmutafa I think this question is better asked on StackOverflow with the content of
/Users/admin/fir/android/gradle/wrapper/gradle-wrapper.propertiesPhilParisot commentedon Nov 6, 2018
This issue should be closed now as it was resolved with the latest Dev upgrade and the master channel before that.
Even the issue that I was having before was different and was related to my AMD cpu. This specific issue is fixed.
wulameng commentedon Dec 23, 2018
@chuckiefan thanks,dude! its solve my problem
change order fix build error
augustheart commentedon Feb 26, 2019
or replace https with http then you can use any version gradle
anota commentedon May 16, 2019
use gradle 3.1.0 fixed
dependencies { classpath 'com.android.tools.build:gradle:3.1.0' }sj-on commentedon Apr 27, 2020
It is already present there. But still it is not working.
faramarzkhani commentedon Feb 19, 2021
thanks man it works
github-actions commentedon Aug 5, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.