この質問に対処するスレッドはたくさんあるようですが、どれも私のために働いていません。私の問題は、新しいプロジェクトを開始するたびにRが赤く強調表示され、プロジェクトが実行されないことです。新しいプロジェクト作成時にシンボルRを解決できない
は幸いにも - 簡略化のために - 私は任意のコードを実装していない、プロジェクト内のすべてのコードは、単に新しいプロジェクトの作成により作成されたコードです:
package com.abc.android.unnamed;
import android.app.Activity;
import android.os.Bundle;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
XMLファイルは変更されません:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.abc.android.unnamed.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
私が試してみました:
- は、プロジェクトファイルを削除して、新しいprojeを作成しますビルド>クリーンプロジェクトを行うCT
- は、[ビルド]> [同じ結果をもたらすすべてがプロジェクト
を再構築します。
たびに、Gradleのコンソールが表示されます。
私はこの問題を修正するために何ができますか?