Android studio: Problem with crash when opening application 2.0

Find the problem

A cliché, maybe this thing is really common, in the previous article
linkhttp://t.csdnimg.cn /UJQNb
We have already talked about the problem that after opening the software developed by Androidstuidio, there is no error but it cannot run (specifically, the application crashes)
Insert image description here
So why still I have to write another article about this problem, because I encountered this problem again later, and the previous solution did not work

analyse problem

Like the previous article, I still found that the program was installed successfully but could not run
Insert image description here
After checking the logcat, I found that
Insert image description here
the problem still seemed to be with the page. Corresponding, so the author went to AndroidManifest.xml to check, but found that it had already been corresponding
Insert image description here

Solution

Since the previous method is useless, let’s try something else. The author checked the error page reported by logcat and found a problem
Insert image description here
The mainActivity here What is inherited is AppCompatActivity instead of Activity. Could this be the reason?
Insert image description here
After modification, it can indeed run without crashing.
Insert image description here
After checking The reason was found to be
Insert image description here
linkhttp://t.csdnimg.cn/KzSgL
which is explained in detail in this article. You can read it

Supongo que te gusta

Origin blog.csdn.net/m0_72471315/article/details/134812624
Recomendado
Clasificación