Ich arbeitete an meiner App und alles war normal, bis ich versuchte, Bild in Java anzuzeigen.Android Studio: Gradle: Fehler: kann Symbolvariable nicht finden
Ich habe die App einmal ausgeführt und es lief normal, das Bild wurde angezeigt. Danach wurde ich gebeten, einige Bibliotheken zu importieren, und ich importierte sie. Danach habe ich Fehler für meine Aktivitäten bekommen.
Fehler wie:
Gradle: error: cannot find symbol variable activity_main
Gradle: error: cannot find symbol variable button1
Gradle: error: cannot find symbol variable button2
Gradle: error: cannot find symbol variable textView
Gradle: error: cannot find symbol variable secondActivity
In MainActivity ich diese Bibliotheken importiert haben:
import android.R;
import android.content.Intent;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.Button;
und in secondActivity diese:
import android.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
Wer weiß, wie dieses Problem beheben?
EDIT: Ich löschte import android.R;
und jetzt funktioniert es normal.
Ein Gradle resync hat das für mich behoben. – akiraspeirs