Error: java: package R does not exist

2019-07-17 15:13发布

问题:

Im new to android development coding my first app. I know this question has been asked many time but im still unable to solve the problem. I guess if i explain my scenario someone might able to help me solve the problem.

I've followed a tutorial and successfully implemented GCM Push Notification. Now i want to add this functionality to my existing android app. So i copied all the files to my app and when i build project i get:

Error:(39, 25) java: package R does not exist

All XML files are good, no errors.

Package name of my Push Notification app is:

com.androidhive.pushnotifications

Folder structure of my app is:

- src
 -- com
  --- funstuff
   ---- pushnotifications (.java files here)

Every thing works fine in my test app that i created following tutorial, but when i copied files into my project im getting package R does not exist error.

Am i doing something wrong? Is there another way of importing functionality into app without disturbing it?

Any help regarding this is highly appreciated. Thanks!

Im using intelliJ IDE.