Git Product home page Git Product logo

fataar-gradle-plugin's Introduction

Mobbeel fat AAR Gradle plugin

In Mobbeel we work with a complex hierarchy of modules that in turn must embed other dependencies in the resulting AAR. To do this we use this Gradle plugin that allows to merge a project and its dependencies in the same AAR (fat-aar).

Issue reporting are welcome to continue to improve this plugin.

Plugin work with Android gradle plugin 3.0.0 o higher

Features

  • Support external dependencies from workspace (example: api "com.mobbeel:my-lib:1.0.0")

  • Support internal dependencies (example: api project(':My-lib-module'))

  • Support internal/external native dependencies

  • Support internal/external AAR dependencies

  • Support add transitive dependencies from pom.xml on jar dependencies

  • [NEW] Merge resources from AAR dependencies

How to use?

  1. Configure your buildscript to include the plugin:
buildscript {
  repositories {
    maven { url "https://plugins.gradle.org/m2/" }
  }
  dependencies {
    classpath "com.mobbeel.plugin:fat-aar:2.0.1"
  }
}
  1. Apply the plugin on the top of your library module build.gradle:
apply plugin: "com.mobbeel.plugin"
  1. Mark with 'api' configuration dependecies that need embed on the final AAR:
dependencies {
    api "com.mobbeel:my-lib:1.0.0"  // <- Embed external dependency from any repository
    api project(':My-lib-module')   // <- Embed internal dependency on workspace

    ...
}

Add to fat AAR all transitive dependencies

By default, the transitive dependencies that define a dependency are not added to the fat AAR. You can add them by adding these settings:

aarPlugin {
    includeAllInnerDependencies true  // It's false for default
}

fataar-gradle-plugin's People

Contributors

andreyneura avatar jonbryantnz avatar liushuai42 avatar oscarcpozas avatar rafaelitajuba avatar rafaelrabeloit avatar rafaelring avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fataar-gradle-plugin's Issues

Merged aar not contain R$layout issue

Hi,recently I use the fataar gradle plugin, find the merged aar not contain R$layout.
Please help me check the issue, thanks~

Gradle config

// merge-sdk module build gradle

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
compileOnly 'com.android.support:appcompat-v7:28.0.0'
compileOnly 'com.android.support.constraint:constraint-layout:1.1.3'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

api project(path: ':comp-sdk')
api project(path: ':comp-featureA')
api project(path: ':comp-featureB')
api project(path: ':prov-common')
api project(path: ':libp-image')
api project(path: ':lib-image')
api project(path: ':lib-base')

}

Stack

java.lang.NoSuchFieldError: No field abc_action_bar_view_list_nav_layout of type I in class Lcom/android/component/merge/sdk/R$layout; or its superclasses (declaration of 'com.android.component.merge.sdk.R$layout' appears in /data/app/com.android.component-1/base.apk)

Crash when renaming jar file

Hello!

From CopyDependenciesTask.groovy, the line (#191)
rename "classes.jar", "${dependency.group.toLowerCase()}-${dependency.name.toLowerCase()}-${dependency.version}.jar"
will crash if the dependency object's group or version methods return null.

According to the gradle documentation for the Dependency these methods are annotated as @nullable (i.e. returning null is a possibility).

Thanks,
Jon

PS Cheers for developing this plugin, it's very much appreciated!

R.txt cannot generate

What are the steps to reproduce this issue?

  1. …gradle version 3.2.1
  2. …the dependencies in both library submodule contains android support lib
  3. …gradle procedure stop at the copyreleasedependencies function, the output variant is abc_fade_in 0x7f010001. I consider when this error will occur when this value appears in different R.txt which will be merged

What happens?

…R.txt cannot generate

What were you expecting to happen?

…Generate the R.txt

Missing required attribute: dependency groupId POM

Why published pom could not be included? I get multiple errors and after running info I get following errors:

<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>test</groupId>
  <artifactId>com.test</artifactId>
  <version>0.0.2.7</version>
  <packaging>aar</packaging>
  <dependencies>
    <dependency>
      <artifactId>build.aar</artifactId>
      <type>aar</type>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>*</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.android.support</groupId>
      <artifactId>appcompat-v7</artifactId>
      <version>27.1.1</version>
      <scope>runtime</scope>
    </dependency>
  </dependencies>
</project>

And assemble provides this info:

Could not parse POM
> Missing required attribute: dependency groupId

BUILD FAILED when building fat AAR

What are the steps to reproduce this issue?

I am using the command
gradle clean assemble --stacktrace to create the AAR on a library project.

What happens?

BUILD FAILED

What were you expecting to happen?

I was expecting it to build the fat AAR

Any logs, error output, etc?

https://ghostbin.com/paste/66huy

Any other comments?

The following are being used in the environment:
classpath "com.mobbeel.plugin:fat-aar:2.0.1"
classpath 'com.android.tools.build:gradle:3.4.0'
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

Internal dependency minify issue

After assemble release task,my main module minify is successfully, but my sub module minify is failed。
I'm sure minifyEnabled is true in sub module build.gradle.
How can I solve the problem?

Run assembleRelease or assembleDebug task of example-lib, the output aar does not include the nested-lib and nested-native-lib

What are the steps to reproduce this issue?

  1. Run the assembleRelease or assembleDebug task of example-lib;
  2. The AAR is generated in the build/output/aar directory;
  3. But the AAR does not include the example-nested-lib and example-nested-native-lib

What happens?

the AAR does not include the example-nested-lib and example-nested-native-lib

What were you expecting to happen?

Since the build.gradle of example-lib declared the dependencies of example-nested-lib and example-nested-native-lib, it should include the them in the AAR.

Any logs, error output, etc?

(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)

Any other comments?

If the assembleRelease or assembleDebug of example-nested-lib and example-nested-native-lib is run before, let say these two AARs are generated. Then run the assembleRelease or assembleDebug of example-lib, the output AAR will include all its dependencies incorrectly.

Resources R.java is not working properly

What are the steps to reproduce this issue?

  1. create FAT-AAR using in a module
    implementation('com.google.android.gms:play-services-analytics:11.8.0')
  2. try to use that FAT AAR as library

What happens?

The application is not able to find some resources.. it seems that the play-services library is adding elements to R

Any logs, error output, etc?

(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)
couldn't find static field Lcom/package/R$string;.common_google_play_services_enable_button
couldn't find static field Lcom/package/R$attr;.buttonSize

05-31 12:26:39.915 3684-3684/com.midtronics.android.launcher E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.midtronics.android.launcher, PID: 3684
java.lang.NoSuchFieldError: com.midtronics.android.corelibrary.R$attr.buttonSize
at com.midtronics.android.mdxui.R$attr.(R.java:179)

Rewrite plugin to Kotlin

For better integration with IDE (Android Studio) and use the same language across the project instead of Groovy.

android.tools.build:gradle:3.1.0 issues

This plugin can be packed normally in version 3.0.0. But It does not work properly in version 3.1.0.

This is the result of packaging in android.tools.build:gradle:3.1.0:

mylibrary-unspecified.aar
---libs
    ---base.jar
    ---gson-2.8.2.jar
    ---gson-2.8.2-sources.jar
---AndroidManifest.xml

Support for multiple flavours

If I have multiple flavours of my library e.g. free/premium

Then in my dependencies:

freeApi project('freeModule')
premiumApi project('premiumModule')

Having this support to generate various flavours of the AAR would be nice

Test issue

What are the steps to reproduce this issue?

What happens?

What were you expecting to happen?

Any logs, error output, etc?

(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)

Any other comments?

Do not support publish generated aar to maven

I have a aar lib, call as B.aar here, it dependent another aar, call A.aar.
your plugin works when assemble locally.
but after I publish my aar lib B to maven repo via uploadArchives, the B.aar file uploaded on maven server still not contains A.aar.

What does packagesToInclude do?

Just wondering. Is it necessary? should it specify the package of the library for example: package com.demo.lib;
packagesToInclude = ['com.demo.lib']

two libraries can't merge to one aar file

What are the steps to reproduce this issue?

I completely follow your instructions. Different things, my module contains Activity, and some resource files, not just some java classes. If there are only java classes, it is just placed directly in the library. No need to use a custom gradle to operate.
What happens?

Build successful ! but Alibrary containing Activity and some resource files don't merge to BLibrary and Finally the Artfact aar does not include ALibrary's Activity, and some resource files.

What were you expecting to happen?

the Artfact aar includes ALibrary's Activity, and some resource files.

Any logs, error output, etc?

(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)
no
Any other comments?

no

Thanks.

chinese characters not support

in you demo i insert chinese characters in string.xml then build throw this exception"com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 2 字节的 UTF-8 序列的字节 2 无效" already add in xml head encoding="utf-8"
thanks !

Doesn't build project dependencies

What are the steps to reproduce this issue?

  1. From a clean workspace, build example-lib

What happens?

The library produced does not contain an AAR for the example-nested-lib project dependency

What were you expecting to happen?

The library to build an AAR for the project dependency, and embed that in the example-lib AAR

Any logs, error output, etc?

N/A

Any other comments?

The dependency is detected according to the Gradle logging:
Internal android dependency detected -> example-nested-lib

The example-lib AAR is produced correctly if the example-nested-lib AAR has been built beforehand.

The plugin may remove duplicated module and maintain only one version

What are the steps to reproduce this issue?

  1. Followed by README

What happens?

Modules with same name but different versions were added into the aar

What were you expecting to happen?

The plugin may filter out those duplicated same dependencies, or give an option to choose which version should be maintained

Any logs, error output, etc?

External dependency detected -> com.my.library:2.1.7
Artifact: com.my.library-sources.jar
   |--> Exclude for source jar
POM: com.my.library-2.1.7.pom
   |--> Inner dependency: com.squareup.picasso:picasso:2.5.2
   /--> picasso-2.5.2.pom
   |--> Inner dependency: com.squareup.okhttp:okhttp:
   /--> okhttp-2.7.5.pom
   |--> Inner dependency: com.squareup.okio:okio:
   /--> okio-1.6.0.pom
   |--> Inner dependency: org.codehaus.mojo:animal-sniffer-annotations:
   /--> animal-sniffer-annotations-1.14.pom
   /--> okio-1.8.0.pom
   |--> Inner dependency: org.codehaus.mojo:animal-sniffer-annotations:
   /--> animal-sniffer-annotations-1.14.pom
   /--> okio-1.9.0.pom
   |--> Inner dependency: org.codehaus.mojo:animal-sniffer-annotations:
   /--> animal-sniffer-annotations-1.14.pom
   /--> okio-1.0.1.pom
   |--> Inner dependency: org.codehaus.mojo:animal-sniffer-annotations:
   /--> animal-sniffer-annotations-1.14.pom
   /--> okio-1.14.0.pom
   |--> Inner dependency: org.codehaus.mojo:animal-sniffer-annotations:
   /--> animal-sniffer-annotations-1.14.pom
   /--> okio-1.13.0.pom
   |--> Inner dependency: org.codehaus.mojo:animal-sniffer-annotations:
   /--> animal-sniffer-annotations-1.14.pom
   /--> okio-1.3.0.pom
   |--> Inner dependency: org.codehaus.mojo:animal-sniffer-annotations:
   /--> animal-sniffer-annotations-1.14.pom
   /--> okhttp-2.5.0.pom
   |--> Inner dependency: com.squareup.okio:okio:
   /--> okio-1.6.0.pom
   |--> Inner dependency: org.codehaus.mojo:animal-sniffer-annotations:
   /--> animal-sniffer-annotations-1.14.pom
   /--> okio-1.8.0.pom
   |--> Inner dependency: org.codehaus.mojo:animal-sniffer-annotations:
   /--> animal-sniffer-annotations-1.14.pom
   /--> okio-1.9.0.pom
   |--> Inner dependency: org.codehaus.mojo:animal-sniffer-annotations:
   /--> animal-sniffer-annotations-1.14.pom
   /--> okio-1.0.1.pom
   |--> Inner dependency: org.codehaus.mojo:animal-sniffer-annotations:
   /--> animal-sniffer-annotations-1.14.pom
   /--> okio-1.14.0.pom
   |--> Inner dependency: org.codehaus.mojo:animal-sniffer-annotations:
   /--> animal-sniffer-annotations-1.14.pom
   /--> okio-1.13.0.pom
   |--> Inner dependency: org.codehaus.mojo:animal-sniffer-annotations:
   /--> animal-sniffer-annotations-1.14.pom
   /--> okio-1.3.0.pom
   |--> Inner dependency: org.codehaus.mojo:animal-sniffer-annotations:
   /--> animal-sniffer-annotations-1.14.pom
   /--> okhttp-2.3.0.pom
   |--> Inner dependency: com.squareup.okio:okio:
   /--> okio-1.6.0.pom
   |--> Inner dependency: org.codehaus.mojo:animal-sniffer-annotations:
   /--> animal-sniffer-annotations-1.14.pom
   /--> okio-1.8.0.pom
   |--> Inner dependency: org.codehaus.mojo:animal-sniffer-annotations:
   /--> animal-sniffer-annotations-1.14.pom
   /--> okio-1.9.0.pom
   |--> Inner dependency: org.codehaus.mojo:animal-sniffer-annotations:
   /--> animal-sniffer-annotations-1.14.pom
   /--> okio-1.0.1.pom
   |--> Inner dependency: org.codehaus.mojo:animal-sniffer-annotations:
   /--> animal-sniffer-annotations-1.14.pom
   /--> okio-1.14.0.pom
   |--> Inner dependency: org.codehaus.mojo:animal-sniffer-annotations:
   /--> animal-sniffer-annotations-1.14.pom
   /--> okio-1.13.0.pom
   |--> Inner dependency: org.codehaus.mojo:animal-sniffer-annotations:
   /--> animal-sniffer-annotations-1.14.pom
   /--> okio-1.3.0.pom

BTW, the plugin really saved my life, thanks for your contribution!

Merging resources causing package R to not exist

What are the steps to reproduce this issue?

  1. Add the plugin following the instructions
  2. Run ./gradlew build

What happens?

100 errors in the R.java file, all of them being error: package R does not exist

What were you expecting to happen?

Build completing without these errors

Any logs, error output, etc?

100 similar instances to the following:

{module_directory}/build/tmp/copyDebugDependencies/rs/androidx/viewpager/R.java:5: error: package com.(package_name).R does not exist
public static int alpha = com.(package_name).R.attr.alpha;

Any other comments?

Module Gradle Dependencies:

dependencies {
def lifecycle_version = '2.0.0-beta01'
def paging_version = '2.0.0-beta01'
def anko_version = '0.10.8'
def lottieVersion = '3.0.1'

implementation 'com.facebook.android:facebook-login:[4,5)'
api fileTree(include: ['*.jar'], dir: 'libs')
api 'androidx.appcompat:appcompat:1.1.0-alpha05'
api 'androidx.recyclerview:recyclerview:1.1.0-alpha05'
api 'com.google.android.material:material:1.1.0-alpha06'
api 'androidx.emoji:emoji:1.0.0'
api 'androidx.emoji:emoji-bundled:1.0.0'
api 'androidx.emoji:emoji-appcompat:1.0.0'
api 'de.hdodenhof:circleimageview:3.0.0'
testImplementation 'junit:junit:4.13-beta-3'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
api 'androidx.constraintlayout:constraintlayout:2.0.0-alpha5'
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
api(name: 'dms', ext: 'aar')
api(name: 'audiohelper', ext: 'aar')
api 'com.squareup.retrofit2:retrofit:2.5.0'
api 'com.squareup.retrofit2:converter-gson:2.5.0'
api project(':camerahelper')
api 'com.google.android.gms:play-services-maps:16.0.0'
api 'com.google.android.gms:play-services-location:16.0.0'
api "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
api "androidx.paging:paging-runtime:$paging_version"
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
api 'androidx.multidex:multidex:2.0.0'
api 'com.braintreepayments:card-form:3.3.0'
api 'com.shuhart.stickyheader:stickyheader:1.0.5'
api "org.jetbrains.anko:anko:$anko_version"
api 'io.smooch:core:5.17.4'
api 'io.smooch:ui:5.17.4'
api 'com.google.zxing:core:3.3.3'
api 'io.branch.sdk.android:library:3.+'
api 'androidx.legacy:legacy-support-v4:1.0.0-beta01'
api 'com.pawegio.kandroid:kandroid:0.6.12@aar'
api 'com.github.jinatonic.confetti:confetti:1.1.2'
api 'com.google.android.gms:play-services-auth:16.0.1'
api 'org.jsoup:jsoup:1.11.3'
api 'android.arch.navigation:navigation-fragment:1.0.0'
api 'androidx.cardview:cardview:1.0.0-beta01'
api "com.airbnb.android:lottie:$lottieVersion"
api 'androidx.viewpager:viewpager:1.0.0'
api project(':DragToClose')
api 'com.hbb20:ccp:2.2.9'
api 'com.google.firebase:firebase-auth:16.0.4'
api 'joda-time:joda-time:2.10.2'
api "com.mixpanel.android:mixpanel-android:5.5.0"
api 'com.google.android.gms:play-services-analytics:16.0.8'
api 'com.xwray:groupie:2.3.0'
api 'com.xwray:groupie-kotlin-android-extensions:2.3.0'
api 'com.yarolegovich:discrete-scrollview:1.4.9'
api 'com.google.android:flexbox:1.1.0'
api 'com.eightbitlab:blurview:1.6.1'
api 'androidx.test.ext:junit:1.1.1'
api 'androidx.test.espresso:espresso-idling-resource:3.3.0-alpha02'
implementation project(':ccconsumersdk-consumerSwiper-release')

}

Gradle Plugin: 3.4.2
Gradle Version: 5.1.1
FatAAR plugin version: 2.0.1

Wrong detection of JAVA library as Android lib

What are the steps to reproduce this issue?

Add java library api dependency

What happens?

Library is detected as Android library and missing android property

Version:
Tested with 2.0.1, 2.0.2 & 2.0.2
Gradle: 4.8
Android Gradle Plugin: 3.2.1

Logs:

> Task :fat-aar:assembleRelease

> Task :fat-aar:copyReleaseDependencies FAILED
int string app_name 0x7f150001
Internal android dependency detected -> java-lib
* What went wrong:
Execution failed for task ':fat-aar:copyReleaseDependencies'.
> Could not get unknown property 'android' for project ':java-lib' of type org.gradle.api.Project.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':fat-aar:copyReleaseDependencies'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:11
0)
....
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:130)
        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: groovy.lang.MissingPropertyException: Could not get unknown property 'android' for project ':java-lib' of type org
.gradle.api.Project.
        at org.gradle.internal.metaobject.AbstractDynamicObject.getMissingProperty(AbstractDynamicObject.java:83)

Error building AAR

What are the steps to reproduce this issue?

  1. I have follow the plugin configuration steps

What happens?

When I try to build the AAR file, I get the build error "Error:No signature of method: java.util.ArrayList.all() is applicable for argument types: (com.mobbeel.plugin.DependencyProcessorPlugin$_apply_closure1$_closure6$_closure7) values: [com.mobbeel.plugin.DependencyProcessorPlugin$_apply_closure1$_closure6$_closure7@645f2d36]
Possible solutions: tail(), any(), tail(), last(), last(), add(java.lang.Object)"

What were you expecting to happen?

I expect the AAR file to be built correctly.

Any logs, error output, etc?

No

Any other comments?

No

No source code included

What are the steps to reproduce this issue?

  1. Flow the steps

image

What happens?

I created my fat-aar.

What were you expecting to happen?
image


My source code does not contain。

Any logs, error output, etc?

(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)

Any other comments?

Merge layouts

What are the steps to reproduce this issue?

  1. Create project A and add some layouts
  2. Import project A's aar to project B. All layouts from project A are accessible as expected.
  3. Create fat aar with project A and project B
  4. Import fat aar to project C. The layouts from project A are not accessible and app crashes if some class from project B uses a layout from project A (which was working normally before the fat aar) . All project B layouts are accessible.

What happens?
The layout files are in .aar/class.jar/res/layout and not in .aar/layout. The R file from project A is missing too. I use minifyEnabled true with no shrinking and no optimizations. I am relatively new to aar so I dont know if this is a bug or I m missing something. Any advice would be nice!

I use gradle 3.2.0 and fat-aar version 2.0.2

Modules in subfolder

What are the steps to reproduce this issue?

  1. Have a project with modules in a subfolder
  2. something like this implementation project(':subfolder:module')

What happens?

The plugin can not find the module.

What were you expecting to happen?

The plugin can find the module.

Any logs, error output, etc?

11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':example-lib:copyDebugDependencies'.
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Cannot get property 'buildDir' on null object
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --scan to get full insights.
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is:
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':example-lib:copyDebugDependencies'.
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
11:47:27.144 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: java.lang.NullPointerException: Cannot get property 'buildDir' on null object
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at com.mobbeel.plugin.task.CopyDependenciesTask$_analyzeDependencies_closure13.doCall(CopyDependenciesTask.groovy:133)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at com.mobbeel.plugin.task.CopyDependenciesTask.analyzeDependencies(CopyDependenciesTask.groovy:126)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at com.mobbeel.plugin.task.CopyDependenciesTask.executeTask(CopyDependenciesTask.groovy:29)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:780)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:747)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
11:47:27.145 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)

Any other comments?

I don't know if is a common use have the subfolders but I think is something important in order to have a better structure.

Could not set unknown property 'archiveName' for task

Versions

Gradle: 8.1.0
Gradle wrappers: 8.0
Fataar: 2.0.1

What are the steps to reproduce this issue?

  1. ./gradlew build

What happens?

A problem occurred configuring project ':project'.
> Could not set unknown property 'archiveName' for task ':project:createRsJarAarDebug' of type org.gradle.jvm.tasks.Jar.

What were you expecting to happen?

Synch project with gradle files

Any logs, error output, etc?

(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)

A problem occurred configuring project ':norsk-tipping-oddsen-android'.
> Could not set unknown property 'archiveName' for task ':project:createRsJarAarDebug' of type org.gradle.jvm.tasks.Jar.

Any other comments?

Won't the AAR files that libraries depend on be packaged in?

There is my dependencies those aar file not found

dependencies {
api fileTree(include: ['*.jar'], dir: 'libs')
api 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
api 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.8'

api(name: 'alisdk-feedback-2.5.0', ext: 'aar')
api(name: 'securityguardaar3-5.1.81', ext: 'aar')
api(name: 'doutu_sdk_v1.03', ext: 'aar')

}

Support for local external dependencies

Hello,

Summary
aar libraries that are stored locally in the projects libs directory and are referenced as dependent aren't packaged in the final aar.

Example
If we reference a local aar library directly within the build.gradle files dependencies:

dependencies {
    api (name: 'example-native-local-lib', ext: 'aar')
}

And within the sample file structure we have the below file:
example-lib/libs/example-native-local-lib.aar

This library isn't included in the built aar.

Code
When the analyzeDependencies() method within CopyDependenciesTask.groovy detects an external dependency, it expects the dependant libraries path to be found at the following location:
<gradleUserHomeDir>/caches/modules-2/files-2.1/

This is fine if the dependency has been downloaded from an external repository however
this isn't always the case (as demonstrated in the above example).

Thanks,
Jon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.