skip to Main Content

I tried adding dagger to my project by adding
implementation "com.google.dagger:dagger:$rootProject.dagger2Version" (based on answer of Liubomyr Protsyk in: this question)

in build.gradle and It resulted with "Could not get unknown property ‘dagger2Version’ for root project …" which I understand, what I cannot understand is why after removing that line I cannot sync gradle project… Every try to use "try again"
enter image description here

results in:

Caused by: java.lang.IllegalArgumentException: Cannot convert string value 'UNIFIED_TEST_PLATFORM' to an enum value of type 'com.android.builder.model.AndroidGradlePluginProjectFlags$BooleanFlag' (valid case insensitive values: APPLICATION_R_CLASS_CONSTANT_IDS, TEST_R_CLASS_CONSTANT_IDS, TRANSITIVE_R_CLASS, JETPACK_COMPOSE, ML_MODEL_BINDING)

any ideas how to fix that? I honestly have no clue, so any help will be appreciated.

2

Answers


  1. Defining dagger2Version as extras before trying to access it may help:

    project.ext.set('dagger2Version', '2.40.5')
    

    And the getter also seems to be wrong:

    rootProject.ext.get('dagger2Version')
    
    Login or Signup to reply.
  2. In case anyone has the same error, you need to update Android Studio to the latest version

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search