import com.amap.api.location.AMapLocation;
import com.amap.api.location.AMapLocationClient;
import com.amap.api.location.AMapLocationClientOption;
import com.amap.api.location.AMapLocationListener;
标红出错原因:
缺少AMap_Location的jar包
例如:缺少AMap_Location_V5.1.0_20200708.jar
方法一:我下载SDK的时候没找到,可以从官方给出的demo的lib文件夹中找到
方法二:在build.gradle中添加
implementation 'com.amap.api:location:latest.integration'