cordova-android: Build is failing while generating the framework-8.0.0.aar file

Bug Report

I am faced with a problem wherein framework-8.0.0.aar file, the build is failing. However, the file is being generated and the same is building versions upto 7.1.4.

Problem

I am faced with a problem wherein framework-8.0.0.aar file, the build is failing.

What is expected to happen?

The aar file should be generated successfully.

What does actually happen?

The build fails and an error is shown.

* What went wrong:
Execution failed for task ':packageDebugResources'.
> Could not resolve all files for configuration ':_internal_aapt2_binary'.
   > Could not find com.android.tools.build:aapt2:3.3.0-5013011.
     Searched in the following locations:
       - file:/Users/Apple/Library/Android/sdk/extras/m2repository/com/android/tools/build/aapt2/3.3.0-5013011/aapt2-3.3.0-5013011.pom
       - file:/Users/Apple/Library/Android/sdk/extras/m2repository/com/android/tools/build/aapt2/3.3.0-5013011/aapt2-3.3.0-5013011-osx.jar
       - file:/Users/Apple/Library/Android/sdk/extras/google/m2repository/com/android/tools/build/aapt2/3.3.0-5013011/aapt2-3.3.0-5013011.pom
       - file:/Users/Apple/Library/Android/sdk/extras/google/m2repository/com/android/tools/build/aapt2/3.3.0-5013011/aapt2-3.3.0-5013011-osx.jar
       - file:/Users/Apple/Library/Android/sdk/extras/android/m2repository/com/android/tools/build/aapt2/3.3.0-5013011/aapt2-3.3.0-5013011.pom
       - file:/Users/Apple/Library/Android/sdk/extras/android/m2repository/com/android/tools/build/aapt2/3.3.0-5013011/aapt2-3.3.0-5013011-osx.jar
     Required by:
         project :

Information

I am faced with a problem wherein framework-8.0.0.aar file, the build is failing. However, the file is being generated and the same is building versions upto 7.1.4. Below are the steps I followed to generating the framework-8.0.0.aar file through the cordova-android repo.

  • Under framework/build/outputs/aar identified the framework-8.0.0.aar
  • Checkedout the 8.0.0 tag => git checkout tags/rel/8.0.0
  • Installed and used the latest gradle version of 5.4.1.
  • Navigated to cordova-android/framework directory
  • Build => gradle build
  • The build is failing with the error shown in the attached screenshot.

Command or Code

I am faced with a problem where in framework-8.0.0.aar file, the build is failing. However, the file is being generated and the same is building versions upto 7.1.4. Below are the steps I followed to generating the framework-8.0.0.aar file through the cordova-android repo.

  • Under framework/build/outputs/aar identified the framework-8.0.0.aar
  • Checkedout the 8.0.0 tag => git checkout tags/rel/8.0.0
  • Installed and used the latest gradle version of 5.4.1.
  • Navigated to cordova-android/framework directory
  • Build => gradle build
  • The build is failing with the error shown in the attached screenshot.

Environment, Platform, Device

Mentioned above.

Version information

Checklist

ErrorMessage

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 28 (14 by maintainers)

Most upvoted comments

This was fixed in https://github.com/apache/cordova-android/pull/676.

As for the released contents that are on Bintray, for version 8.0.0, I manually patched to create that release.

This fix came after 8.0.0 was released to npm and that is why master was fixed and not 8.0.0.

I still don鈥檛 know what you are doing with that .aar 馃し鈥嶁檧 .

But well, I tried to reproduce and failed with master of cordova-android:

E:\Projects\throwaway
位 git clone https://github.com/apache/cordova-android
Cloning into 'cordova-android'...
remote: Enumerating objects: 54, done.
remote: Counting objects: 100% (54/54), done.
remote: Compressing objects: 100% (37/37), done.
remote: Total 35534 (delta 22), reused 29 (delta 16), pack-reused 35480
Receiving objects: 100% (35534/35534), 35.83 MiB | 5.40 MiB/s, done.
Resolving deltas: 100% (19066/19066), done.

E:\Projects\throwaway
位 cd cordova-android/framework

E:\Projects\throwaway\cordova-android\framework (master -> origin)
位 set ANDROID_HOME
Environment variable ANDROID_HOME not defined

E:\Projects\throwaway\cordova-android\framework (master -> origin)
位 set ANDROID_HOME=C:\Users\Jan\AppData\Local\Android\sdk

E:\Projects\throwaway\cordova-android\framework (master -> origin)
位 set ANDROID_HOME
ANDROID_HOME=C:\Users\Jan\AppData\Local\Android\sdk

E:\Projects\throwaway\cordova-android\framework (master -> origin)
位 gradle build

> Task :lint
Calling mockable JAR artifact transform to create file: C:\Users\Jan\.gradle\caches\transforms-2\files-2.1\348b935b29355b3f5533ec2be760cd20\android.jar with input C:\Users\Jan\AppData\Local\Android\sdk\platforms\android-28\android.jar
Ran lint on variant debug: 1 issues found
Ran lint on variant release: 1 issues found
Wrote HTML report to file:///E:/Projects/throwaway/cordova-android/framework/build/reports/lint-results.html
Wrote XML report to file:///E:/Projects/throwaway/cordova-android/framework/build/reports/lint-results.xml

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 1m 36s
49 actionable tasks: 49 executed
E:\Projects\throwaway\cordova-android\framework (master -> origin)
位

Hi @janpio,

  1. Basically, I am trying to generate an aar file. It is being generated while using any branch/tags upto 7.1.x (https://github.com/apache/cordova-android/tree/7.1.x), but not in branch/tags 8.0.x (https://github.com/apache/cordova-android/tree/8.0.x) and I am getting the attached error.
  2. It is usually generated under framework/build/outputs/aar directory.
  3. I have created the minimal reproduction repository in https://github.com/girigiramesh/reproduction-sample as you had suggested to debug.
  4. Please let me know if you require further. Thanks. error_screenshot

The image contains a reference to Gradle 6

Think you鈥檙e misreading the output here. The reference to Gradle 6 is simply for a warning that deprecated features are used that will be removed in gradle 6. The actual gradle version used is 5.4.1, with the latest version being currently at 5.5.1.

There is known issues using gradle 5.x however, as reported at #754 and #718 so perhaps this is related.