Skip to content

Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.3.1). #23404

Closed

Description

@MarcelEdward2

Flutter crashes on Resolving dependencies

* 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

Activity

  1. huextrat commented on Oct 23, 2018

    @huextrat

    Same issue here ...

  2. NMateu commented on Oct 23, 2018

    @NMateu

    Should be resolved after merge #23397

  3. Mahi-K commented on Oct 23, 2018

    @Mahi-K

    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

    buildscript {
        repositories {
            google()
            jcenter()
            maven {
                url 'https://dl.google.com/dl/android/maven2'
            }
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.2.1'
        }
    }
    

    and the issue disappeared for me . try these if any one is facing the same issue.

  4. alienfractal commented on Oct 23, 2018

    @alienfractal

    SAme issue here...

  5. pepie commented on Oct 23, 2018

    @pepie

    @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
    
  6. Mahi-K commented on Oct 23, 2018

    @Mahi-K

    @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
    screenshot 2018-10-24 at 00 15 12
    ) 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

  7. zoechi commented on Oct 24, 2018

    @zoechi
    Contributor

    #22953, #23095, #23403 contains a similar error message.

  8. MarcelEdward2 commented on Oct 24, 2018

    @MarcelEdward2
    Author

    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 ?

  9. mrmitew commented on Oct 24, 2018

    @mrmitew
    Contributor

    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

  10. hschenzhimin commented on Oct 24, 2018

    @hschenzhimin

    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
    
  11. MarcelEdward2 commented on Oct 24, 2018

    @MarcelEdward2
    Author

    yes that works, tnx @mrmitew

    I think the maven {} part can be removed, it probably never gets there

  12. added
    c: crash
    tool
    t: gradle
    on Oct 24, 2018
  13. 20 remaining items

  14. ChangJoo-Park commented on Nov 1, 2018

    @ChangJoo-Park

    +1

  15. chuckiefan commented on Nov 1, 2018

    @chuckiefan

    @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.

  16. PhilParisot commented on Nov 1, 2018

    @PhilParisot

    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!

  17. mohammedmutafa commented on Nov 6, 2018

    @mohammedmutafa
    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.
    
  18. zoechi commented on Nov 6, 2018

    @zoechi
    Contributor

    @mohammedmutafa I think this question is better asked on StackOverflow with the content of /Users/admin/fir/android/gradle/wrapper/gradle-wrapper.properties

  19. PhilParisot commented on Nov 6, 2018

    @PhilParisot

    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.

  20. wulameng commented on Dec 23, 2018

    @wulameng

    @chuckiefan thanks,dude! its solve my problem

  21. added a commit that references this issue on Jan 11, 2019
  22. augustheart commented on Feb 26, 2019

    @augustheart

    or replace https with http then you can use any version gradle

  23. anota commented on May 16, 2019

    @anota

    use gradle 3.1.0 fixed
    dependencies { classpath 'com.android.tools.build:gradle:3.1.0' }

  24. sj-on commented on Apr 27, 2020

    @sj-on

    It is already present there. But still it is not working.

  25. faramarzkhani commented on Feb 19, 2021

    @faramarzkhani

    use gradle 3.1.0 fixed
    dependencies { classpath 'com.android.tools.build:gradle:3.1.0' }

    thanks man it works

  26. github-actions commented on Aug 5, 2021

    @github-actions

    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.

  27. locked as resolved and limited conversation to collaborators on Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: crasht: gradletoolwaiting for PR to land (fixed)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions