Package R does not exist

Issue #14 resolved
Mitch Claborn created an issue

See discussion at https://groups.google.com/forum/#!topic/nbandroid-discuss/sDW381hJTcA

IDE log with fine logging attached.


Still working in my sample NBAndroid Gradle project. The code for my main activity is shown below. In the IDE, I get the error "package R does not exist" with the wavy red underline on the bolded line below. The project runs fine in the emulator. What's wrong with it?

package com.csc.mm.nbandrois2;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

public class MainActivity extends Activity {
  private static final String TAG = MainActivity.class.getSimpleName();

  /**
   * Called when the activity is first created.
   */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    System.out.println(this.getClass().getSimpleName() + "  onCreate()");
    Log.d(TAG, "starting!!!");
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
  }
}

Comments (3)

  1. Radim Kubacki

    After a discussion with Tomas Z. from NetBeans team I will add explicit refresh for build for after build/test/run commands to poke classpath update.

    Seems to work for me - sometimes there is a glitch when switch between editor tabs is needed to reparse the source but overall I couldn't reproduce this problem in any consistent way (Debian Linux 3.11, JDK7.u45).

  2. Log in to comment