Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unresolved reference: R in Android with Navigation-args

After updating Android Studio I have this error with Navigation-args

Build failed
API 'BaseVariant.getApplicationIdTextResource' is obsolete and has been replaced with 'ApplicationVariant.applicationId'.
It will be removed in version 9.0 of the Android Gradle plugin.
For more information, see TBD.
To determine what is calling BaseVariant.getApplicationIdTextResource, use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
:app:compileDebugKotlin
SearchNsdFragmentDirections.kt
Unresolved reference: R
Unresolved reference: R
org.gradle.api.GradleException: Compilation error. See log for more details

Any idea about it?

I tried to revert gradle-wrapper properties and revert other libraries...

like image 693
MisterAnt Avatar asked Oct 12 '25 11:10

MisterAnt


1 Answers

Solution: Its because you are missing the package name in a manifest file here:

<manifest 
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.yourname"

I clicked in Android Studio suggestion and it removed package name from Manifest. Now it works properly!

like image 66
MisterAnt Avatar answered Oct 15 '25 00:10

MisterAnt