我正在开发一个使用 GPS 定位服务的 Android 应用程序。我昨天能够编译并运行它,但今天我打开 Android Studio 并且 Location 包中的,LocationListener
不会导入(它说无法解析符号 LocationListener)。LocationRequest
LocationServices
事实上,当我做Control+时,我看不到包的任何类Space,例如我可以看到com.google.android.gms.common.api
包的类。
项目 build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "gps.example.com.myapplicationgps"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.google.android.gms:play-services:8.4.0'
}