javaandroidr.java-file

R.Java don't create


R.Java don't create because I have errore in code an I accidentally deleted R.java.

Here is the code:

public SwipeyTabs(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);

        final TypedArray a = context.obtainStyledAttributes(attrs,
                R.styleable.SwipeyTabs, defStyle, 0);

        mBottomBarColor = a.getColor(R.styleable.SwipeyTabs_bottomBarColor,
                mBottomBarColor);
        mBottomBarHeight = a.getDimensionPixelSize(
                R.styleable.SwipeyTabs_bottomBarHeight, 2);
        mTabIndicatorHeight = a.getDimensionPixelSize(
                R.styleable.SwipeyTabs_tabIndicatorHeight, 3);

        a.recycle();

        init();



    }

And in xml

 <com.example.uniradio.SwipeyTabs
    android:id="@+id/swipeytabs"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="#ff3b3b3b"
    swipeytabs:bottomBarColor="#ff96aa39"
    swipeytabs:bottomBarHeight="2dip"
    swipeytabs:tabIndicatorHeight="3dip" />

Now, how do I create it?


Solution

  • You can basically do it two ways:

    You can either run it from eclipse as suggested here, by going to Project -> Build Project, or simply running a "clean"

    build android project

    Or you can try and create an APK of your app via command line, which will then generate the .R files as well as the APK.

    If there are any errors, the command line will report it.

    To do it via command line, you can run the following:

    ant release
    

    From within your project directory