user3857111
user3857111

Reputation: 11

How do I fix "unknown entity 'R' "?

I am using AIDE on my Nexus 7 and suddenly I am unable to build / run my App. I get 18 errors of this kind and yes I've already tried turning it off and on again.

Upvotes: 1

Views: 4978

Answers (4)

DiLDoST
DiLDoST

Reputation: 372

Goto your project (In File Browser) and delete the build folder and do a rebuild. I had the same problem and is fixed

Upvotes: 0

Protean
Protean

Reputation: 483

This will happen when you change the package name and forget to update the applicationId in the app's build.gradle file.

Upvotes: 0

user4494077
user4494077

Reputation:

Check your namespaces (package name) and also folder structure.

I had this error when I change namespace of *.java files, and forget make namespace change also in build.gradle file of project (android - defaultConfig - applicationId). AIDE then try to import non-existent R, and shows the error, because generated resources are in another namespace (package).

Another option is to go to main menu in AIDE then "more..." - "code" - "organize imports" and see what choices you have to choose for importing R.

Upvotes: 2

Geoffrey Roussel
Geoffrey Roussel

Reputation: 11

Removing the autogenerated build/ folder and build.gradle file i was able to build again but not to install(with no details), had to recreate a fresh app project and copyback sources and resources.

Upvotes: 1

Related Questions