Skip to content
Advertisement

Dagger Hilt –Error: annotation @AggregatedRoot is missing a default value for the element ‘originatingRoot’–

Im using Dagger Hilt in my project and its not compilating. Checked everything in manifest and project files and have no idea what is happenning :/

error: annotation @AggregatedRoot is missing a default value for the element 'originatingRoot'
@AggregatedRoot(
^warning: File for type 'com.example.mikebamb.EquipmentsApplication_HiltComponents' created in the last round 
will not be subject to annotation processing.warning: File for type 'dagger.hilt.internal.processedrootsentinel.codegen._com_example_mikebamb_EquipmentsApplication' 
created in the last round will not be subject to annotation processing.
> Task :app:kaptDebugKotlin FAILED

EquipmentsApplication Cass

@HiltAndroidApp
class EquipmentsApplication : Application()

Main Activity

@AndroidEntryPoint
class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
    }
}

Manifest File

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.mikebamb">

    <application
        android:name="com.example.mikebamb.EquipmentsApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.MikeBamb">
        <activity android:name=".presenter.MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

Advertisement

Answer

For some reason my versions of the implementation were not matching

Old Version

implementation 'com.google.dagger:hilt-android:2.36'
kapt 'com.google.dagger:hilt-compiler:2.35.1'

Rolled back to

implementation 'com.google.dagger:hilt-android:2.35'
kapt 'com.google.dagger:hilt-compiler:2.35'

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement