gpt4 book ai didi

java - 无法解析符号 'maps'

转载 作者:行者123 更新时间:2023-11-29 18:58:14 26 4
gpt4 key购买 nike

我导入了 mixare Android Studio 3.1 的源代码,但我在以下几行中收到错误消息 Cannot resolve symbol 'maps':

import com.google.android.maps.GeoPoint;
import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;
import com.google.android.maps.Projection;

我看到了this page但没有一个答案有帮助。我该如何解决这个问题?

build.gradle:

apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion '27.0.3'

defaultConfig {
applicationId 'org.mixare'
minSdkVersion 14
targetSdkVersion 24
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}

dependencies {
implementation project(':mixarelib')
implementation 'com.google.android.gms:play-services-maps:12.0.0'
}

AndroidManifest.xml:

  <application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
tools:ignore="AllowBackup"
tools:replace="android:label">
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="(API KEY)" />

<uses-library android:name="com.google.android.maps" />
...

最佳答案

我很轻松地解决了这个问题。

转到设置 |外观与行为 | Android SDK 并选中“显示包详细信息”。

选择 SDK 版本(我选择 7.0),勾选“Google APIs”并安装。不知道为什么7.1.1以上的版本没有这个选项。

然后像这样配置build.gradle:

compileSdkVersion 'Google Inc.:Google APIs:24'

关于java - 无法解析符号 'maps',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49526866/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com