1

When i create a new layout in Android Studio , I can't put anything on it literally (with root element android.support.v7.widget.Toolbar, by going layout->new->ressourse file)

I can't even change the background color! it shows me

"android/view/view$on unhandled keyevent listener"

the error is on the photo number 2

enter image description here enter image description here

Philipp
  • 468
  • 3
  • 24
El Moudir
  • 21
  • 1
  • 4
  • possible duplicate: https://stackoverflow.com/questions/51305964/android-view-viewonunhandledkeyeventlistener-onmeasure-error – Philipp Jul 19 '18 at 23:42
  • i know this , and it dosen't work for me.. – El Moudir Jul 19 '18 at 23:45
  • You should have mentioned that. Does it compile successfully? – Philipp Jul 19 '18 at 23:59
  • no , when i sync , it dosen't compile https://scontent.ftun2-1.fna.fbcdn.net/v/t1.0-9/37426830_1117011955104874_7624362283853938688_n.jpg?_nc_cat=0&oh=c7b6ab366c0436629608890278bdfb7a&oe=5BC76BB9 – El Moudir Jul 20 '18 at 00:03

2 Answers2

0

I don't see anything underlined. Try the following


  1. Install the missing plattforms like Android Studio suggests in your screenshot from the comments

  2. Be sure to add implementation 'com.android.support:appcompat-v7:27.1.1' to your build.gradle

  3. If that doesn't work maybe it's just a rendering problem for the design preview. Therefore you can switch to another Theme right above the UI which says AppTheme.

Let me know if this helps

Philipp
  • 468
  • 3
  • 24
0
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.1.1'
//noinspection GradleCompatible
implementation 'com.android.support:design:27.1.1'

add these two library hope this will work

  • i changed but they are underlined with red and i can create a layout (fixed) , i did not change the CompileSdKversion and the CompileSdkVersion to 27 , and now i find a another problem who i sturggeled with : https://scontent.ftun4-1.fna.fbcdn.net/v/t1.0-9/37639552_1119742624831807_6512686660155604992_n.jpg?_nc_cat=0&oh=5a96c97b3aa43196c721d413ef51a8c8&oe=5BE43718 "the platform cannot support ssr " – El Moudir Jul 22 '18 at 13:01
  • can you send code of "android/view/view$on unhandled keyevent listener" this error – Rishikesh Mhatre Jul 22 '18 at 13:36
  • this error no more happened when i changed to 27.1.1 but they were underlined with red ! like this photo i send already in the comment , and the other error if you know it before (pllatform cannot support ssr ) – El Moudir Jul 22 '18 at 13:45