I had two API version(21,27) in my SDK platform and my Virtual Device was also targeting API 21. The problem was MediaPlayer in my MainActivity was not working. I checked volume , it was obviously turned on but could here no sound. So i thought the higher API version(In my case, API 27) might be causing the problem so i uninstalled it. and now every singe code has turned into red-which means error occured)as u can see. enter image description here
would you give insight of what is the cause and how to fix it? Thanks you so much in advance.
download every api version and try
start with api 27 and keep coming down but you don't have to delete the sdk version
Latest android studio version should use latest build tools and better to target with current popular version just like:
your project build.gradle should set like that:
compileSdkVersion 26
buildToolsVersion "27.0.3"
defaultConfig {
minSdkVersion 21
targetSdkVersion 27
set your min support sdk if the app support from SDK 21 to 27. Should install back the latest sdk 27
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.