Man*_*att 9 java android android-studio
我正在尝试运行此应用程序,但它给了我错误,我不明白这个错误的含义?
我在build.gradle文件中也添加了google play服务库:
apply plugin: 'com.android.application'
android {
compileSdkVersion 'Google Inc.:Google APIs:21'
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "act.com.mapdemo"
minSdkVersion 19
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:6.5.87'
}
Run Code Online (Sandbox Code Playgroud)
我的xml文件:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
当我运行它时给我错误:
Gradle 'mapdemo' project refresh failed
Error:Could not normalize path for file 'E:\WorkSpace\mapdemo\app\build\intermediates\mockable-Google Inc.:Google APIs:21.jar'.
The filename, directory name, or volume label syntax is incorrect
Run Code Online (Sandbox Code Playgroud)
Sea*_*eau 28
将您的Android Gradle插件版本更改为:
dependencies {
classpath 'com.android.tools.build:gradle:1.1.2'
}
Run Code Online (Sandbox Code Playgroud)
这是早期版本的插件中的一个错误,它没有正确地逃避Windows上的非法字符,并在v1.1.2中修复:
https://code.google.com/p/android/issues/detail?id=148912
看起来您使用的是 Windows 并且文件名包含冒号。但在 Windows 下,文件名不得包含以下任何字符:/:*?"<>|
E:\WorkSpace\mapdemo\app\build\intermediates\mockable-Google Inc.:Google APIs:21.jar
^ ^
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6410 次 |
| 最近记录: |