Cannot create new activity in android studio

后端 未结 9 1272
猫巷女王i
猫巷女王i 2021-01-02 09:48

I keep getting an IllegalStateException error in the event log while creating new activity in android studio:

11:27:15 InvalidReferenceException         


        
9条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-02 10:12

    I have been faced that, after I setup my android environment.I already set up and configured everything, but this still occur.After searching a few mins, I found the problem in Logcat,

    Then, I know project is missing Build Tool version. You have to give which build tool version you will use to run for project. Go to >> Project Structure , ( Cmd + ; ) in mac. Choose Compile Sdk Version and Build Tools Version, After the gradle build, creating new activity from menu error has been fixed. I hope this will help for you.

    Notes : Some of the projects from Github or bitbucket also missing Build Tools version when you cloned and run the project. These are the same errors and this approach can help to solve for them.

提交回复
热议问题