Android Studio:包含 Google 地图时的编译器设置
2022-09-04 02:11:12
我在Android Studio中创建了一个新项目,并添加了一个Google Maps活动。
我收到以下警告:
warning: com/google/android/gms/maps/GoogleMap.class(com/google/android/gms/maps:GoogleMap.class): major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
warning: com/google/android/gms/maps/SupportMapFragment.class(com/google/android/gms/maps:SupportMapFragment.class): major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
warning: com/google/android/gms/maps/model/LatLng.class(com/google/android/gms/maps/model:LatLng.class): major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
warning: com/google/android/gms/maps/model/MarkerOptions.class(com/google/android/gms/maps/model:MarkerOptions.class): major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
warning: com/google/android/gms/maps/model/Marker.class(com/google/android/gms/maps/model:Marker.class): major version 51 is newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
我的猜测是我有一个JDK不匹配什么的。我安装了JDK 7,当我做javac -version时,我看到1.7.0_65。我在Android Studio的首选项中更改了Project字节码版本,但这并没有改变这些警告。
我的 build.gradle 有这个
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// You must install or update the Google Repository through the SDK manager to use this dependency.
compile 'com.google.android.gms:play-services:5.0.77'
compile 'com.android.support:support-v13:18.0.+'
}
我需要做些什么来修复这些警告,或者我应该在 Android Studio 中忽略它们?