(Android studio 3.1) the ImageView control is used in the layout file, and Src refers to the vector asset file created by itself. When running on Android 4.42, an error is reported as follows:
I used it on Android 8.0 mobile phone before, but it didn’t appear this problem. When I ran it on Android 4.42, I made a mistake. The first time I met this problem, I didn’t know what was wrong. Later, when I solved another problem, I suddenly realized that this problem might come from:
In the development process, I’m used to Android mode, and there are only a few folders in the res directory. Switch to project mode. In addition to the drawable folder, there is also the drawable-v24 folder in the res directory. I found that the vector asset file I created was actually placed in drawable-v24. Maybe that’s the problem. So I moved the vector asset file from the drawable-24 folder to the drawable directory, and then there was no running error.
Later, I went to the blog to search for information and found that Google only provided vector support when Android 5.0 was released. No wonder there was no error when I created the vector asset file to run in the drawable folder in Android 8.0. Maybe it was because vector was relatively mature in higher versions. Finally, a blog about vector written by Dashen is attached https://blog.csdn.net/eclipsexys/article/details/51838119 u>, I feel that I have learned a lot, which is convenient for further inquiry in the future.
Read More:
- [Android] button uses the custom drawable file to set the background, and runs “error inflating class button”
- How to keep textview and ImageView on the same line
- Error inflating class android.support.v7.widget.SearchView
- Error inflating class TextView [How to Solve]
- Wechat applet background image error
- android studio:Error inflating class android.support.v4.widget.SwipeRefreshLayout
- Android error reporting: error inflating class android.webkit.WebView
- Error inflating class in WebView in Android 5. X android.webkit.WebView Solutions
- Error inflating class fragment error when loading custom fragment with fragment (valid)
- Ueditor paste word image and upload image file automatically
- The scan of annotations for web application [] could not be completed due to a stackoverflower error. Possible root causes include the low setting of – XSS and illegal circular inheritance dependencies. The class hierarchy being processed is
- VTK cultivation 26: basic operation of image_ Three dimensional image slice extraction
- Apache [error] server reached MaxClients setting, consider raising the MaxClients setting
- [docker] error in deleting image: image is referenced in multiple repositories
- Ant Design upload listtype = “picture card” realizes multi image upload and click preview image encapsulation
- ImageIO.read () unsupported image type when reading picture_ exception Unsupported Image Type
- Ms- settings:personalization-background terms of settlement
- Cocos creator 2.4.5 2D RPG (Infinite scrolling background implementation)
- Running bat batch file in background
- Traversing the background data to generate tree structure