当前位置: 首页 > 知识库问答 >
问题:

Android Studio:包含谷歌地图时的编译器设置

沃皓轩
2023-03-14

我在Android工作室创建了一个新项目,并添加了一个谷歌地图活动。

我得到了这些警告:

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.
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工作室中忽略它们?

共有1个答案

轩辕季同
2023-03-14

“主要版本”是指Java版本。Java 7=51,Java 6=50。代码是为Java7编写的,这是Android的dex所支持的。我不确定您用它构建的东西不是为Java7设置的,但这就是问题所在。项目中的Maven构建可以正常工作。我没有看到您提到的错误,它可能也与Java6 vs 7有关。

 类似资料:
  • 当我在pubspec中包含“谷歌地图”依赖项时。亚马尔 我的构建失败: 正在启动lib\main。在调试模式下为x86构建的Android SDK上的dart。。。D8:程序类型已存在:android。支持v4。媒体MediaBrowserCompat$ConnectionCallback$ConnectionCallbackInternal****************************

  • 所以我看到了一个特殊的例外,我敢肯定的是谷歌地图的绘图代码。 我有一个片段,在那里我以编程方式添加了一个支持地图片段,然后我在其中操纵谷歌地图实例。 这是stacktrace: 我无法可靠地复制它(尽管这种情况经常发生),我已经查看了ReadWriteDirectByteBuffer和ShortToByteBufferAdapter,但没有任何东西突然出现在我面前。 有什么想法吗?

  • 我认为问题是我需要添加构建提示。我可以找到在哪里添加他们,但我不确定他们应该是什么格式。我也不知道要补充什么。我想我发现了一个帖子,说我需要添加Android.xapplication=Android:value=“Your Key”/>Android.xPermissions= 但我不确定构建提示条目表单中的格式是什么

  •        LSV默认的对谷歌影像进行了加载,如果需要加载其他的谷歌地图数据,可以通过LSV中直接点击即可加载。

  • 我有一些问题与谷歌地图地理编码api。 我正在使用谷歌地图,并尝试使用回调函数对地址进行地理编码: 以及html代码: 地图不显示。 但是,如果我打电话: 使用回调函数之外的固定lat和lng,一切正常。 有线索吗? 谢谢你宝贵的帮助:)

  • 我正在用VueJS在Laravel 5.7中构建一个应用程序。我有一个谷歌地图(使用vue2谷歌地图构建),有200个标记,每个标记都有一个信息窗口。我想在infoWindow中包含一个路由器链接,但由于该链接是作为字符串传递的,所以Vue似乎没有对其进行解析。 这是我目前的组件-除了路由器链接,所有的工作 有人能建议一种方法来解析路由器链接吗? 谢谢你