Android的工作室:包括谷歌地图时所编译器设置 [英] Android Studio: what compiler settings when including Google Maps

查看:208
本文介绍了Android的工作室:包括谷歌地图时所编译器设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了Android的Studio中的一个新项目,并添加了谷歌地图的活动。

I created a new project in Android Studio and added a Google Maps activity.

我得到这些警告:

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。我改变了机器人工作室的preferences项目字节code版本,但并没有改变这些警告。

My guess is that I have a JDK miss-match or something. I installed JDK 7, and when I do javac -version I see 1.7.0_65. I changed in Android Studio's preferences the Project bytecode version but that didn't change these warnings.

我build.gradle有这个

My build.gradle has this

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.+'
}

什么我需要做修复这些警告,或者我应该忽略他们的机器人工作室?

What do I need to do to fix these warnings, or should I ignore them in Android Studio?

推荐答案

主要版本指的Java版本。 Java的7 = 51,Java的6 = 50。code是Java 7中写的,那就是Android的DEX支持的东西。我不知道你正在与不是针对Java 7中设置的是什么,但是这就是问题所在。 Maven构建项目中的正常工作。我没有看到你提到的错误,它可能与Java的6比7了。

"Major version" means Java version. Java 7 = 51, Java 6 = 50. The code is written for Java 7, and that is something that Android's dex supports. I am not sure what you are building with that is not set for Java 7, but that's the problem. The Maven build in the project works correctly. I don't see the error you mention, and it may be related to Java 6 vs 7 too.

这篇关于Android的工作室:包括谷歌地图时所编译器设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆