Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using enableAggregatingTask does not generate classes #2695

Closed
AlexanderEggers opened this issue Jun 15, 2021 · 27 comments · Fixed by #2728
Closed

Using enableAggregatingTask does not generate classes #2695

AlexanderEggers opened this issue Jun 15, 2021 · 27 comments · Fixed by #2728

Comments

@AlexanderEggers
Copy link

AlexanderEggers commented Jun 15, 2021

When using the dagger 2.37 with the enableAggregatingTask flag set to true, several required classes are not generated anymore. For example the Hilt_MyApplication does not exist anymore, but also several class dependencies. It seems that only the injector related classes are created. When using enableExperimentalClasspathAggregation (without enableAggregatingTask), everything is working fine.

@danysantiago
Copy link
Member

Can you provide more information? Do you have tests failing? is your APK failing to compile? What sort of error are you seeing?

With enableAggregatingTask the Hilt_MyApplication along with a the component classes are generated and compiled in a separate task different than the main javac or kapt tasks, the compiled bytecode is then added as part of the build process.

@AlexanderEggers
Copy link
Author

The apk compiling is running fine but when I start the app, the app crashes with "Class not found exception". When having a look at the build folder, the crash is valid because expected classes are not available (like Hilt_MyApplication).

@danysantiago
Copy link
Member

The Hilt_MyApplication should be in the build folder, just on a different spot than usual, specifically in build/generated/hilt/component_sources/.

@danysantiago
Copy link
Member

Do you have a repro project you can share?

Some more questions to try and help us figure this out:

  • Do you have build variants or product flavors, if so, is the issue present in other variants?
  • Is your project in Java or Kotlin?
  • Do you have custom annotation processor flag? Which and how are you setting those?

@AlexanderEggers
Copy link
Author

Do you have a repro project you can share?

Nothing I can share at this moment.

Do you have build variants or product flavors, if so, is the issue present in other variants?

Present in every build and product flavor that exists in the project.

Is your project in Java or Kotlin?

Kotlin code only.

Do you have custom annotation processor flag? Which and how are you setting those?

I have no custom annotation processor flags present in the project.

The Hilt_MyApplication should be in the build folder, just on a different spot than usual, specifically in build/generated/hilt/component_sources/.

That folder does not exist for me. When using enableExperimentalClasspathAggregation the files are created as part of \build\generated\source\kapt\devMockDebug\com\demo\app. This folder includes all expected files. When using enableAggregatingTask, this folder only contains the injector generated classes but nothing else.

@danysantiago
Copy link
Member

This might be hard to repro without a sample app...

I got more questions though:

  • Do you see this when building from command line or Android Studio only or both?
  • What version of the Android Gradle Plugin are you using?
  • When you run the build command (like ./gradlew assembleDebug for example) do you see Hilt related tasks named hiltJavaCompile* or hiltAggregateDeps* execute? You can also do ./gradlew assembleDbeug --dry-run to only output the tasks to execute. If you share the whole output, even better.

@AlexanderEggers
Copy link
Author

I can create a sample app but that might take until next month (or longer) until I get the needed time to spend on that.

Do you see this when building from command line or Android Studio only or both?

I can see the issue when building from Android Studio and command line.

What version of the Android Gradle Plugin are you using?

4.2.1

When you run the build command (like ./gradlew assembleDebug for example) do you see Hilt related tasks named hiltJavaCompile* or hiltAggregateDeps* execute? You can also do ./gradlew assembleDbeug --dry-run to only output the tasks to execute. If you share the whole output, even better.

Both tasks are executed, but hiltJavaCompile is stated as Task :app:hiltJavaCompileDevMockDebug NO-SOURCE.

@aeroxr1
Copy link

aeroxr1 commented Jun 18, 2021

Seems my same issue. I didn't see this and I opened another issue.. sorry :(
This is the repository where is the project with the issue:
https://github.com/aeroxr1/ExampleAppWithHmsAndGms/tree/feature/hilt

@AlexanderEggers
Copy link
Author

Thanks for sharing the example project, @aeroxr1. @danysantiago is that enough for you and your team to reproduce and potentially fix the issue?

@danysantiago
Copy link
Member

Thanks for the sample app @aeroxr1, I'll take a look and report back.

@danysantiago
Copy link
Member

@aeroxr1 do you have any specific repro steps?

I was able to clone and run the sample app successfully. Building and installing :app:assembleAlphaGoogleDebug worked fine and so did other variants (such as :app:assembleBetaGoogleDebug) including the proguarded release variants.

I can see the right files being generated:

~/Downloads/ExampleAppWithHmsAndGms-feature-hilt/app/build/intermediates/hilt
❯ tree .
.
└── component_classes
    ├── alphaGoogleDebug
    │   ├── aeroxr1
    │   │   └── pocHybridHmsGms
    │   │       ├── DaggerPocApplication_HiltComponents_SingletonC$1.class
    │   │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCBuilder.class
    │   │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl$ActivityCBuilder.class
    │   │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl$ActivityCImpl$FragmentCBuilder.class
    │   │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl$ActivityCImpl$FragmentCI$ViewWithFragmentCBuilder.class
    │   │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl$ActivityCImpl$FragmentCI$ViewWithFragmentCI.class
    │   │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl$ActivityCImpl$FragmentCI.class
    │   │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl$ActivityCImpl$ViewCBuilder.class
    │   │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl$ActivityCImpl$ViewCI.class
    │   │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl$ActivityCImpl.class
    │   │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl$ViewModelCBuilder.class
    │   │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl$ViewModelCImpl.class
    │   │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl.class
    │   │       ├── DaggerPocApplication_HiltComponents_SingletonC$Builder.class
    │   │       ├── DaggerPocApplication_HiltComponents_SingletonC$ServiceCBuilder.class
    │   │       ├── DaggerPocApplication_HiltComponents_SingletonC$ServiceCImpl.class
    │   │       ├── DaggerPocApplication_HiltComponents_SingletonC.class
    │   │       ├── Hilt_PocApplication$1.class
    │   │       ├── Hilt_PocApplication.class
    │   │       ├── PocApplication_ComponentTreeDeps.class
    │   │       ├── PocApplication_HiltComponents$ActivityC$Builder.class
    │   │       ├── PocApplication_HiltComponents$ActivityC.class
    │   │       ├── PocApplication_HiltComponents$ActivityCBuilderModule.class
    │   │       ├── PocApplication_HiltComponents$ActivityRetainedC$Builder.class
    │   │       ├── PocApplication_HiltComponents$ActivityRetainedC.class
    │   │       ├── PocApplication_HiltComponents$ActivityRetainedCBuilderModule.class
    │   │       ├── PocApplication_HiltComponents$FragmentC$Builder.class
    │   │       ├── PocApplication_HiltComponents$FragmentC.class
    │   │       ├── PocApplication_HiltComponents$FragmentCBuilderModule.class
    │   │       ├── PocApplication_HiltComponents$ServiceC$Builder.class
    │   │       ├── PocApplication_HiltComponents$ServiceC.class
    │   │       ├── PocApplication_HiltComponents$ServiceCBuilderModule.class
    │   │       ├── PocApplication_HiltComponents$SingletonC.class
    │   │       ├── PocApplication_HiltComponents$ViewC$Builder.class
    │   │       ├── PocApplication_HiltComponents$ViewC.class
    │   │       ├── PocApplication_HiltComponents$ViewCBuilderModule.class
    │   │       ├── PocApplication_HiltComponents$ViewModelC$Builder.class
    │   │       ├── PocApplication_HiltComponents$ViewModelC.class
    │   │       ├── PocApplication_HiltComponents$ViewModelCBuilderModule.class
    │   │       ├── PocApplication_HiltComponents$ViewWithFragmentC$Builder.class
    │   │       ├── PocApplication_HiltComponents$ViewWithFragmentC.class
    │   │       ├── PocApplication_HiltComponents$ViewWithFragmentCBuilderModule.class
    │   │       └── PocApplication_HiltComponents.class
    │   └── dagger
    │       └── hilt
    │           └── internal
    │               └── processedrootsentinel
    │                   └── codegen
    │                       └── _aeroxr1_pocHybridHmsGms_PocApplication.class
    └── betaGoogleDebug
        ├── aeroxr1
        │   └── pocHybridHmsGms
        │       ├── DaggerPocApplication_HiltComponents_SingletonC$1.class
        │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCBuilder.class
        │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl$ActivityCBuilder.class
        │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl$ActivityCImpl$FragmentCBuilder.class
        │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl$ActivityCImpl$FragmentCI$ViewWithFragmentCBuilder.class
        │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl$ActivityCImpl$FragmentCI$ViewWithFragmentCI.class
        │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl$ActivityCImpl$FragmentCI.class
        │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl$ActivityCImpl$ViewCBuilder.class
        │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl$ActivityCImpl$ViewCI.class
        │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl$ActivityCImpl.class
        │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl$ViewModelCBuilder.class
        │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl$ViewModelCImpl.class
        │       ├── DaggerPocApplication_HiltComponents_SingletonC$ActivityRetainedCImpl.class
        │       ├── DaggerPocApplication_HiltComponents_SingletonC$Builder.class
        │       ├── DaggerPocApplication_HiltComponents_SingletonC$ServiceCBuilder.class
        │       ├── DaggerPocApplication_HiltComponents_SingletonC$ServiceCImpl.class
        │       ├── DaggerPocApplication_HiltComponents_SingletonC.class
        │       ├── Hilt_PocApplication$1.class
        │       ├── Hilt_PocApplication.class
        │       ├── PocApplication_ComponentTreeDeps.class
        │       ├── PocApplication_HiltComponents$ActivityC$Builder.class
        │       ├── PocApplication_HiltComponents$ActivityC.class
        │       ├── PocApplication_HiltComponents$ActivityCBuilderModule.class
        │       ├── PocApplication_HiltComponents$ActivityRetainedC$Builder.class
        │       ├── PocApplication_HiltComponents$ActivityRetainedC.class
        │       ├── PocApplication_HiltComponents$ActivityRetainedCBuilderModule.class
        │       ├── PocApplication_HiltComponents$FragmentC$Builder.class
        │       ├── PocApplication_HiltComponents$FragmentC.class
        │       ├── PocApplication_HiltComponents$FragmentCBuilderModule.class
        │       ├── PocApplication_HiltComponents$ServiceC$Builder.class
        │       ├── PocApplication_HiltComponents$ServiceC.class
        │       ├── PocApplication_HiltComponents$ServiceCBuilderModule.class
        │       ├── PocApplication_HiltComponents$SingletonC.class
        │       ├── PocApplication_HiltComponents$ViewC$Builder.class
        │       ├── PocApplication_HiltComponents$ViewC.class
        │       ├── PocApplication_HiltComponents$ViewCBuilderModule.class
        │       ├── PocApplication_HiltComponents$ViewModelC$Builder.class
        │       ├── PocApplication_HiltComponents$ViewModelC.class
        │       ├── PocApplication_HiltComponents$ViewModelCBuilderModule.class
        │       ├── PocApplication_HiltComponents$ViewWithFragmentC$Builder.class
        │       ├── PocApplication_HiltComponents$ViewWithFragmentC.class
        │       ├── PocApplication_HiltComponents$ViewWithFragmentCBuilderModule.class
        │       └── PocApplication_HiltComponents.class
        └── dagger
            └── hilt
                └── internal
                    └── processedrootsentinel
                        └── codegen
                            └── _aeroxr1_pocHybridHmsGms_PocApplication.class

17 directories, 88 files

Inspecting the APK and dex files also show the generated application being correctly included:
Screen Shot 2021-06-18 at 10 12 14 AM

@aeroxr1
Copy link

aeroxr1 commented Jun 20, 2021

Hi @danysantiago

I run the app branch feature/hilt from Android Studio 4.2.1 on Samsung tab s6.
Gradle version 6.8
JDK embedded in AS.

The app starts, but it immediately crash with this stacktrace:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: aeroxr1.pocHybridHmsGms, PID: 10681
    java.lang.RuntimeException: Unable to instantiate application aeroxr1.pocHybridHmsGms.PocApplication: java.lang.ClassNotFoundException: Didn't find class "aeroxr1.pocHybridHmsGms.PocApplication" on path: DexPathList[[zip file "/data/app/aeroxr1.pocHybridHmsGms-3ZrSvD5zYe6EJ3Je0nisPg==/base.apk"],nativeLibraryDirectories=[/data/app/aeroxr1.pocHybridHmsGms-3ZrSvD5zYe6EJ3Je0nisPg==/lib/arm64, /data/app/aeroxr1.pocHybridHmsGms-3ZrSvD5zYe6EJ3Je0nisPg==/base.apk!/lib/arm64-v8a, /system/lib64]]
        at android.app.LoadedApk.makeApplication(LoadedApk.java:1296)
        at android.app.ActivityThread.handleMakeApplication(ActivityThread.java:7152)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7134)
        at android.app.ActivityThread.access$1600(ActivityThread.java:274)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2102)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:8167)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "aeroxr1.pocHybridHmsGms.PocApplication" on path: DexPathList[[zip file "/data/app/aeroxr1.pocHybridHmsGms-3ZrSvD5zYe6EJ3Je0nisPg==/base.apk"],nativeLibraryDirectories=[/data/app/aeroxr1.pocHybridHmsGms-3ZrSvD5zYe6EJ3Je0nisPg==/lib/arm64, /data/app/aeroxr1.pocHybridHmsGms-3ZrSvD5zYe6EJ3Je0nisPg==/base.apk!/lib/arm64-v8a, /system/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at android.app.AppComponentFactory.instantiateApplication(AppComponentFactory.java:76)
        at androidx.core.app.CoreComponentFactory.instantiateApplication(CoreComponentFactory.java:52)
        at android.app.Instrumentation.newApplication(Instrumentation.java:1156)
        at android.app.LoadedApk.makeApplication(LoadedApk.java:1288)
        at android.app.ActivityThread.handleMakeApplication(ActivityThread.java:7152) 
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7134) 
        at android.app.ActivityThread.access$1600(ActivityThread.java:274) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2102) 
        at android.os.Handler.dispatchMessage(Handler.java:107) 
        at android.os.Looper.loop(Looper.java:237) 
        at android.app.ActivityThread.main(ActivityThread.java:8167) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100) 
    	Suppressed: java.lang.NoClassDefFoundError: Failed resolution of: Laeroxr1/pocHybridHmsGms/Hilt_PocApplication;
        at java.lang.VMClassLoader.findLoadedClass(Native Method)
        at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
        		... 15 more
     Caused by: java.lang.ClassNotFoundException: Didn't find class "aeroxr1.pocHybridHmsGms.Hilt_PocApplication" on path: DexPathList[[zip file "/data/app/aeroxr1.pocHybridHmsGms-3ZrSvD5zYe6EJ3Je0nisPg==/base.apk"],nativeLibraryDirectories=[/data/app/aeroxr1.pocHybridHmsGms-3ZrSvD5zYe6EJ3Je0nisPg==/lib/arm64, /data/app/aeroxr1.pocHybridHmsGms-3ZrSvD5zYe6EJ3Je0nisPg==/base.apk!/lib/arm64-v8a, /system/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        		... 18 more

Moreover i don't see ../app/build/intermediates/hilt directory

@safaorhan
Copy link

safaorhan commented Jun 21, 2021

I'm having trouble with a similar problem.

After setting enableAggregatingTask = true flag in my :app module, :app:transformProdReleaseUnitTestClassesWithAsm task started to fail with exception:

> java.nio.file.NoSuchFileException: .../app/build/intermediates/hilt/component_classes/prodReleaseUnitTest

When I checked the component_classes directory, I verify that component_classes/prodReleaseUnitTest does not exist. However component_classes/prodRelease exists with the generated classes.

Screen Shot 2021-06-21 at 10 42 01

AGP: 7.0.0-beta03
Hilt: 2.37

PS: I don't use Hilt in my tests or androidTests. Hence I haven't included any testImplementation related to dagger / hilt.

Edit: Task fails both from the terminal using ./gradlew and from the AS itself.

@danysantiago
Copy link
Member

@safaorhan I believe what you are seeing is a different issue related to AGP, see: https://issuetracker.google.com/190438045. You should be able to workaround by adding an empty source file into the unitTest folder.

@aeroxr1 I want to know more about your environment setup:

  • Do you see the issue in an emulator too? Or only on that specific device?
  • What OS do you do development on? Windows, Mac or Linux? (I'm thinking this is related to some file path issue)

Thanks again for providing all the info.

@safaorhan
Copy link

@danysantiago Indeed it is!

Thank you so much!

@safaorhan
Copy link

safaorhan commented Jun 22, 2021

@danysantiago I applied the workaround described in the issue tracker link (https://issuetracker.google.com/190438045) but the problem still continues. (It fixed some of other errors I was getting for the modules that I haven't any test source files)

This is what I get if I run ./gradlew testProdDebugUnitTest while setting the flag

hilt { enableAggregatingTask = true } in the app/build.gradle.kts:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformProdDebugUnitTestClassesWithAsm'.
> java.nio.file.NoSuchFileException: /Users/safa/AndroidStudioProjects/BDouinQuiz/app/build/intermediates/hilt/component_classes/prodDebugUnitTest

* 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 4s
210 actionable tasks: 1 executed, 209 up-to-date

And if I switch to the experimental flag:

hilt { enableExperimentalClasspathAggregation = true }

build succeeds.

I can create a separate issue and can provide more info if you need.

Best,

Safa

@aeroxr1
Copy link

aeroxr1 commented Jun 24, 2021

@safaorhan I believe what you are seeing is a different issue related to AGP, see: https://issuetracker.google.com/190438045. You should be able to workaround by adding an empty source file into the unitTest folder.

@aeroxr1 I want to know more about your environment setup:

  • Do you see the issue in an emulator too? Or only on that specific device?
  • What OS do you do development on? Windows, Mac or Linux? (I'm thinking this is related to some file path issue)

Thanks again for providing all the info.

I'm using Windows. And I have the same issue also on the emulator

@danysantiago
Copy link
Member

Thanks - I was finally able to repro in a dev environment with Windows. Don't have a fix yet but will keep you posted.

@aeroxr1
Copy link

aeroxr1 commented Jun 25, 2021

Thanks - I was finally able to repro in a dev environment with Windows. Don't have a fix yet but will keep you posted.

Thanks ! :)

copybara-service bot pushed a commit that referenced this issue Jun 28, 2021
Using file APIs allows for platform-agnostic path comparisons where as File#parent() returns a String which will contain path separators that are OS specific and will fail to match with the known aggregated packages path that use UNIX-based file separator '/'. Specifically this fixes an issue for Windows users whose file separators are '\'. Note that JarEntry path matching is String based but well formatted Jar files (which are Zip files) regardless of the host OS use forward slashes as path separator.

Fixes #2695

RELNOTES=Fix an issue where `enableAggregatingTask` would not correctly generate Hilt classes when compiling in a dev environment with Windows OS.
PiperOrigin-RevId: 381877388
copybara-service bot pushed a commit that referenced this issue Jun 28, 2021
Using file APIs allows for platform-agnostic path comparisons where as File#parent() returns a String which will contain path separators that are OS specific and will fail to match with the known aggregated packages path that use UNIX-based file separator '/'. Specifically this fixes an issue for Windows users whose file separators are '\'. Note that JarEntry path matching is String based but well formatted Jar files (which are Zip files) regardless of the host OS use forward slashes as path separator.

Fixes #2695

RELNOTES=Fix an issue where `enableAggregatingTask` would not correctly generate Hilt classes when compiling in a dev environment with Windows OS.
PiperOrigin-RevId: 381877388
@andrewhunter0
Copy link

andrewhunter0 commented Jul 14, 2021

@danysantiago Why closed this issue?
I see the modify just committed 15 days ago:a7c3c9e
And i did not find any new version that bigger than 2.37 which released on 11 Jun,
so i can't verify whether the problem has been fixed!

@bcorso
Copy link

bcorso commented Jul 14, 2021

@andrewhunter0 we typically close issues with the commit that fixes them rather than with the release.

You can still verify the fix using the HEAD-SNAPSHOT version. You just need to add the correct repository and update your dagger/hilt versions to HEAD-SNAPSHOT:

// Project-level build.gradle
buildscript {
    ext.daggerVersion = "HEAD-SNAPSHOT"
    repositories {
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    }
}
allprojects {
    repositories {
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    }
}

Because Gradle sometimes gets confused on versions that are not numerical you may also need to add:

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        if (details.requested.group == 'com.google.dagger') {
            details.useVersion 'HEAD-SNAPSHOT'
            details.because 'HEAD-SNAPSHOT should act as latest version.'
        }
    }
}

@andrewhunter0
Copy link

@andrewhunter0 we typically close issues with the commit that fixes them rather than with the release.

You can still verify the fix using the HEAD-SNAPSHOT version. You just need to add the correct repository and update your dagger/hilt versions to HEAD-SNAPSHOT:

// Project-level build.gradle
buildscript {
    ext.daggerVersion = "HEAD-SNAPSHOT"
    repositories {
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    }
}
allprojects {
    repositories {
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    }
}

Because Gradle sometimes gets confused on versions that are not numerical you may also need to add:

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        if (details.requested.group == 'com.google.dagger') {
            details.useVersion 'HEAD-SNAPSHOT'
            details.because 'HEAD-SNAPSHOT should act as latest version.'
        }
    }
}

Ok, thank you, i will try and reply.

@andrewhunter0
Copy link

andrewhunter0 commented Jul 15, 2021

@bcorso
Sorry, i try to verify the fix with your suggestion, but got a exception when added

// Project-level build.gradle
buildscript {
    ext.daggerVersion = "HEAD-SNAPSHOT"
    repositories {
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    }
}

allprojects {
    repositories {
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    }
}

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        if (details.requested.group == 'com.google.dagger') {
            details.useVersion 'HEAD-SNAPSHOT'
            details.because 'HEAD-SNAPSHOT should act as latest version.'
        }
    }
}

What went wrong:
Execution failed for task ':core:lib-base:kaptGenerateStubsDebugKotlin'.

Could not resolve all files for configuration ':core:lib-base:kapt'.
Failed to transform symbol-processing-api-1.5.20-1.0.0-beta03.jar (com.google.devtools.ksp:symbol-processing-api:1.5.20-1.0.0-beta03) to match attributes {artifactType=processed-jar, org.gradle.category=library, org.gra
dle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Could not find symbol-processing-api-1.5.20-1.0.0-beta03.jar (com.google.devtools.ksp:symbol-processing-api:1.5.20-1.0.0-beta03).
Searched in the following locations:
https://maven.aliyun.com/repository/google/com/google/devtools/ksp/symbol-processing-api/1.5.20-1.0.0-beta03/symbol-processing-api-1.5.20-1.0.0-beta03.jar

Because we should use proxy of aliyun to get repository.

But if i removed configurations.all, the original error comes:

Caused by: java.lang.RuntimeException: javassist.NotFoundException: com.xxx.xxx.Hilt_XxxApplication

That is to say, i think i should use the Official released version to verify the fix.
So, can you tell when the new version will be released? thank you!

@bcorso
Copy link

bcorso commented Jul 15, 2021

@andrewhunter0 we plan to do a release this week.

However, besides the version name there's no difference between the current HEAD-SNAPSHOT and our official release, so an official release will make that error go away. We recently added the com.google.devtools.ksp:symbol-processing-api dependency to Dagger, so you'll need to have access to its artifact somehow with the new release.

The artifact is contained in the google() repository, so adding that should fix the error:

// Project-level build.gradle
allprojects {
    repositories {
        google(),
    }
}

@andrewhunter0
Copy link

andrewhunter0 commented Jul 16, 2021

@bcorso
I am so sorry, although i have followed your guidance, and used the HEAD-SNAPSHOT sucessfully(hilt verion is 2.3.7).
image

I still got the same error:

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:launcher:transformClassesWithAndroidEntryPointTransformForXxxDebug'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$3(ExecuteActionsTaskExecuter.java:186)
        at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:268)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:184)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:173)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:411)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:398)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:391)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:377)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: java.lang.RuntimeException: javassist.NotFoundException: com.xxx.xxx.Hilt_XxxApplication
        at com.android.builder.profile.Recorder$Block.handleException(Recorder.java:55)
        at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:108)
        at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:242)
        at jdk.internal.reflect.GeneratedMethodAccessor971.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
        at org.gradle.api.internal.project.taskfactory.IncrementalTaskInputsTaskAction.doExecute(IncrementalTaskInputsTaskAction.java:47)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
        at org.gradle.api.internal.project.taskfactory.AbstractIncrementalTaskAction.execute(AbstractIncrementalTaskAction.java:25)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.run(ExecuteActionsTaskExecuter.java:494)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:479)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:462)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$400(ExecuteActionsTaskExecuter.java:105)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:273)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:251)
        at org.gradle.internal.execution.steps.ExecuteStep.lambda$executeOperation$0(ExecuteStep.java:65)
        at org.gradle.internal.execution.steps.ExecuteStep.executeOperation(ExecuteStep.java:65)
        at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:34)
        at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:47)
        at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:44)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:44)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:34)
        at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:72)
        at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:42)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:53)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:39)
        at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:44)
        at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:77)
        at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:58)
        at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:54)
        at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:32)
        at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:57)
        at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:38)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:63)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:30)
        at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:176)
        at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:76)
        at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:47)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:43)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:32)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:39)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:25)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:102)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:95)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:55)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:39)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:83)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:44)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:96)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:52)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:83)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:54)
        at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:74)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:88)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:88)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:46)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:34)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:43)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution$3.withWorkspace(ExecuteActionsTaskExecuter.java:286)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:43)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:33)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:40)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:30)
        at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:54)
        at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:40)
        at org.gradle.internal.execution.impl.DefaultExecutionEngine.execute(DefaultExecutionEngine.java:41)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:183)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:183)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:173)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:411)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:398)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:391)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:377)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: javassist.NotFoundException: com.xxx.xxx.Hilt_XxxApplication
        at javassist.ClassPool.get(ClassPool.java:430)
        at dagger.hilt.android.plugin.AndroidEntryPointClassTransformer.transformClass(AndroidEntryPointClassTransformer.kt:130)
        at dagger.hilt.android.plugin.AndroidEntryPointClassTransformer.transformClassToOutput(AndroidEntryPointClassTransformer.kt:109)
        at dagger.hilt.android.plugin.AndroidEntryPointClassTransformer.transformFile(AndroidEntryPointClassTransformer.kt:103)
        at dagger.hilt.android.plugin.AndroidEntryPointTransform.transformFile(AndroidEntryPointTransform.kt:156)
        at dagger.hilt.android.plugin.AndroidEntryPointTransform.transform(AndroidEntryPointTransform.kt:124)
        at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:284)
        at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:247)
        at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:106)
        ... 124 more

And the generated files list as below:
image

If i use enableExperimentalClasspathAggregation = true every thing is ok, but when i change to enableAggregatingTask = true, compiling error will come, and this only occurs on window.

Maybe the real reason did not found(a7c3c9e)?
@bcorso

@bcorso
Copy link

bcorso commented Jul 16, 2021

@andrewhunter0 can you verify that you're also using HEAD-SNAPSHOT for the Hilt Gradle plugin (com.google.dagger:hilt-android-gradle-plugin).

@andrewhunter0
Copy link

@andrewhunter0 can you verify that you're also using HEAD-SNAPSHOT for the Hilt Gradle plugin (com.google.dagger:hilt-android-gradle-plugin).

@bcorso
Oh, sorry,that's the problem, after changed version of com.google.dagger:hilt-android-gradle-plugin to HEAD-SNAPSHOT, verything is ok, thank you very much.
Now, i really need the official released version, and wish for it as soon as quickly, and wha't the time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants