0

我正在开发一个使用 GPS 定位服务的 Android 应用程序。我昨天能够编译并运行它,但今天我打开 Android Studio 并且 Location 包中的,LocationListener不会导入(它说无法解析符号 LocationListener)。LocationRequestLocationServices

事实上,当我做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'
}
4

1 回答 1

1

通过清理和构建项目解决了这个问题。

于 2016-03-20T23:00:29.673 回答