Problem: I'm not exactly sure why I'm receiving an error on my AddNote.java
class. This was working before and I see the XML activity is still linked to the class. In fact, this AddNote
is nearly identical to the EditNote
class and activity, which is working, and the AddNote
was created from a copy of the EditNote
activity and class so it could be modified easily.
What I have tried: In comparison with the EditNote
class and activity which is working, I cannot find anything missing. Under onCreate
, the setContentView
references the AddNote activity and the AddNote activty XML context (tools.context
) is set to .AddNote
. None of my other activity classes reference or import android.view.ViewGroup
that I see, so I'm also confused on why I'm receiving this other than maybe it is a downstream result of something else I'm not identifying.
What I have recently done: I have recently updated the JDK, Gradle and dependency versions I was prompted to change. Below are what I'm using and snippets of what I thought were important. If something else is needed, I'm happy to provide it.
- Intellij Idea 2021.1.1
- JDK 11
- Gradle 4.1.3
- Android 29 (min 28)
The Error
C:\Users\..\researchdb\AddNote.java:32: error: cannot access ViewGroup
public class AddNote extends AppCompatActivity {
^
class file for android.view.ViewGroup not found
The Class
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_note);
The Actvity XML
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorGray"
tools:ignore="LabelFor"
tools:context=".AddNote" // <-----------------------
android:id="@+id/lvl_View_Question">