Android Studio 2.2.0.12 designer automatically adds the prefix "@ + id" in front of the view identifier and causes this unusual error

When entering this identifier for a GroupBox (the view does not matter, since this happens with all the views)

This is what I wrote in the id attribute: This is what I wrote in the id attribute: groupBox

Then, after I press ENTER, Android Studio will add the @ + id prefix: Android Studio adds a @ + id prefix

This, after compilation, gives the following error in R.java:

error: type annotations are not supported in -7 (use -source 8 or higher to enable type annotations)

It comes from a string with "@ + id" as a prefix.

public static final class id {
    public static final int @+id/groupBox=0x7f0c0055; // Error comes from this line
    public static final int action0=0x7f0c006e; // ok
    public static final int action_bar=0x7f0c0041; // ok
    public static final int action_bar_activity_content=0x7f0c0000; // ok
    public static final int action_bar_container=0x7f0c0040;  // ok
    // rest of lines ok
    // ...

The project was launched in a previous version of Android Studio, so the rest of the names in the view remain unaffected.

, , , , , - .

=============================================== =========================

+4
1

: Android Studio v2.2.0.12 , "@+ id". Android Studio , (!), Android Studio. .

. Android Studio, . , , .

100% , , / Windows ( 8.1), , . , , .

0

Source: https://habr.com/ru/post/1656003/


All Articles