Search code examples
androidandroid-4.2-jelly-bean

The import com.company.projectname.R cannot be resolved


I am developing an application for the company I work for and I am running into an issue with Eclipse. I've been looking online all over and I cannot seem to find a fix for this specific issue. I have changed import android.R; to import com.company.projectname.R; however I get the error "The import com.company.projectname.R cannot be resolved" obviously I replaced company and projectname with the appropriate values.


Solution

  • Here is an example of what the imports should look like:

    import android.os.Bundle;
    import android.util.Log;
    import android.app.ActionBar.Tab;
    import android.app.Fragment;
    import android.app.FragmentManager;
    import android.app.FragmentTransaction;
    import android.app.ActionBar;
    

    Notice I don't import com.company.projectname.R; Make sure your sdk is updated... After you have done that clean the project.. And rebuild it. You should be fine :D

    -Monkey