Android Studio - Maps.me 设置

标签 android

我正在尝试从 https://github.com/mapswithme/api-android 安装 Maps.me api

从那个网站上说文件 libs 是一个库项目。我点击此链接将库项目添加到 Android Studio - http://www.truiton.com/2015/02/android-studio-add-library-project/

添加库很顺利,我调用了新模块 MapMe

当我进行构建时,出现以下错误。在文件 build.gradle 中的 MapMe 文件夹中找到(此文件是从 libs 导入的) MapsMe - build.gradle

apply plugin: 'android-library'

android {

  // Define these properties in the gradle.properties file in the root project folder
  compileSdkVersion propTargetSdkVersion.toInteger()
  buildToolsVersion propBuildToolsVersion

  defaultConfig {
    minSdkVersion propMinSdkVersion.toInteger()
    targetSdkVersion propTargetSdkVersion.toInteger()
  }

  sourceSets.main {
    manifest.srcFile 'AndroidManifest.xml'
    java.srcDirs = ['src']
    res.srcDirs = ['res']
  }
}

错误是 Error:(6, 1) 评估项目“:MapMe”时出现问题。 在 com.android.build.gradle.LibraryExtension_Decorated@659c6fe1 上找不到属性“propTargetSdkVersion”。

在我的根目录下,在 Gradle Scrpts 下,我看到一个文件 gradle properties(项目属性)。

# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

上面的文件是我应该添加的文件吗?如果是这样,我会添加什么?

谢谢,约翰

最佳答案

尝试在 Maps.me 的 build.gradle 中将所有 prop 版本替换为整数。例如:

compileSdkVersion 17 
buildToolsVersion "19.0.0"

defaultConfig {
    minSdkVersion 7
    targetSdkVersion 16
}

重要提示:将所有这些版本与项目 build.gradle 中提到的原始版本相匹配。

关于Android Studio - Maps.me 设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32173215/

相关文章:

android - 如何将图像上传到 AWS S3 并获取图像文件的 S3 存储桶 url 并一次保存到 dynamodb - Android

android - Google Oauth 多设备

java - 如何提高通话录音音量或打开录音文件来调整声音

android - Eclipse ADT 正式被废弃了吗?

java - 使用 ImageView 显示图库

javascript - Phonegap AJAX 请求未定义

android - sqlite数据库更新

android - 在 Android 中制作文本转语音包装器

c# - 是否有等同于 System.Net.Sockets.UdpClient 的 dot42?

java - 迁移到 android studio 后,Android 主题未应用于 API v19(但应用于 API v21)