0

I am using new version of andriox studio but i am getting some errors while i am running the project, error occurs in ContenetMainbuilding.java file Note: i am using Firebase and fragment as well ** import androidx.constraintlayout.ConstraintLayout; ^ symbol: class ConstraintLayout location: package androidx.constraintlayout enter image description here**

HASHMAT
  • 1
  • 4

1 Answers1

0

You shoule use

androidx.constraintlayout.widget.ConstraintLayout

instead of androidx.constraintlayout.ConstraintLayout

VanSuTuyDuyen
  • 335
  • 2
  • 11
  • doesnt work any other solution ? – HASHMAT May 01 '22 at 06:38
  • afther running the project it automatically goes to the same "androidx.constraintlayout.ConstraintLayoutt" layout and shows the same error , other solution ? – HASHMAT May 01 '22 at 06:41
  • Also, you can enable auto-import by going to `File` - `Settings` - `Editor` - `General` - `Auto Import` and tick on **Add unambigious imports on the fly** & **Optimize imports on the fly** in both Java and Kotlin sections. This will avoid you from mistyping imports. – VanSuTuyDuyen May 01 '22 at 06:42
  • @HASHMAT try add these to your `build.gradle`: ```dependencies { implementation "androidx.constraintlayout:constraintlayout:2.1.3" // To use constraintlayout in compose implementation "androidx.constraintlayout:constraintlayout-compose:1.0.0" }``` – VanSuTuyDuyen May 01 '22 at 06:43
  • i already added this but does not work in my case . – HASHMAT May 01 '22 at 06:49
  • try going to `File` - `Invalidate Caches`, tick on optional and keep going. It's the last resort I can think of. Good luck : ) – VanSuTuyDuyen May 01 '22 at 06:54