1

I used to use Android Studio for program in Android but I've tried IntelliJ, I installed the JDK dowloading them from IntelliJ but I got several problems.

When finished build all seems correct but when I create a button by the view I got these problems:

    The following classes could not be instantiated:
    - android.support.v7.widget.ActionBarContainer (Open Class, Show Exception, Clear Cache)
    - android.support.v7.widget.ActionBarContextView (Open Class, Show Exception, Clear Cache)
    - android.support.v7.app.WindowDecorActionBar (Open Class, Show Exception, Clear Cache)
    Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE.
    If this is an unexpected error you can also try to build the project, then manually refresh the layout.
    Exception Details java.lang.ClassNotFoundException: android.view.View$OnUnhandledKeyEventListener

Tried to install again the JDK but it wasn't work.

Also I got 25 errors like these

    Library Gradle: android.arch.lifecycle:livedata-core-1.1.1 has broken classes path:   C:\Users\sjaim\.gradle\caches\transforms-1\files-1.1\livedata-core-1.1.1.aar\02222d4cd374ded1595eb215970c91b5\res [Fix]
    Library Gradle: android.arch.lifecycle:runtime-1.1.1 has broken classes path:   C:\Users\sjaim\.gradle\caches\transforms-1\files-1.1\runtime-1.1.1.aar\c33133894f42717aa7fb0ac25e7803e6\res [Fix]
    Library Gradle: android.arch.lifecycle:viewmodel-1.1.1 has broken classes path:   C:\Users\sjaim\.gradle\caches\transforms-1\files-1.1\viewmodel-1.1.1.aar\70595dda2942f8e25ef1d377dc2805c6\res [Fix]
Aru
  • 11
  • 2

2 Answers2

0

It looks like a gradle cache problem. You can safely delete the directory .gradle/caches as explained here, and then relaunch a build.

Benoit
  • 5,118
  • 2
  • 24
  • 43
  • That didn't work for me, the first project got worst but new projects have the same problems that my question describes – Aru Sep 21 '18 at 11:50
0

I end solving it, if someone need it I put here how.

First I safely delete Android Studio following this How to completely uninstall Android Studio from windows(v10)?

Then I installed Android Studio again, installed JDK and necesary things. In the first project it will dowload another things and you will have an error like "You will need [module] [Dowload link]" Just reset the project and all should be fine.

Have fun programming!

Aru
  • 11
  • 2