I Updated my Android studio to ChipMunk 2021.2.1 and then Android Studio recommend me to move package name from Android Manifest to build.gradle :
from:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="myPackageName">
...
to:
android {
namespace 'myPackageName'
...
}
And after this change I get this kind of error in all generated Directions classes:
error: package R does not exist
@Override
public int getActionId() {
return R.id.action_navigateToSomewhere;
I’ve read this post but it doesn’t help me.
Workaround: The only way I found to solve the problem is to revert Android Studio recommended changes which seems ridiculous.
I guess it’s a bug in navigation. Is there any other way to solve this problem?
2
Answers
Connect your VPN then
Build/Rebuild project or Invalidate cache and restart
It is working fine in Android Studio Electric Eel | 2022.1.1
You need to move package name from build.gradle app level to manifest as below –
Remove package name from build gradle
Add below line to manifest