(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”
- Aapt2 error: check logs for details
- Error:Execution failed for task’:app:processDebugResources’. Personally resolved
- Several properties of Android listview
- On the error report after the command of ADB shell error:device not A solution of found
- Modifying the default style of scrollbar in Android
- Starbound official mod production (1) & nbsp
- “Failed to convert @ drawable / XX into a drawable exception details are logged in window”
- How to Fix Unknown error: Unable to build: the file dx.jar was not loaded from the SDK folder!
- An error is reported for the new Android project. Rejecting re init on previously failed
- Some file crashing failed, see logs for details
- Android EditText cursor control, color modification, show and hide
- Google browser chrome installation failed, error code: 0xa0430721 solution (★ pro test is feasible 〉)
- Failed to find target with hash string ‘android-25’ in:D:\SDK
- How to use Android android:supportsRtl attribute
- How to keep textview and ImageView on the same line
- Solution of fileuriexposedexception for Android 7.0 behavior change
- Some processing experiences of failed to notify build listener
- UE4 cannot save the asset. The asset uasset failed to save