:checkDebugManifest失败=>财产“清单”中指定的文件不存在 [英] :checkDebugManifest FAILED => file specified for property 'manifest' does not exist

查看:980
本文介绍了:checkDebugManifest失败=>财产“清单”中指定的文件不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立在Eclipse与摇篮现有项目rel=\"nofollow\">。

Using this guide I want to build an existing project in Eclipse with Gradle.

build.grale包括:

build.grale contains:

buildscript {
repositories {
    mavenCentral()
}

dependencies {
    classpath 'com.android.tools.build:gradle:0.14.0'
    }
}
apply plugin: 'android'

android {
    buildToolsVersion "19.1.0"
    compileSdkVersion 16
}

repositories {
    mavenCentral()
}

dependencies {
    compile files('libs/android-support-v4.jar')
}

但我得到:

But I get:

如何解决这个问题?我尝试了好几个小时不同的方法,但似乎没有任何工作。

How to resolve this issue? I tried for several hours different approaches but nothing seemed to work.

推荐答案

默认的项目结构发生了变化,所以,除非你要么告诉摇篮插件在哪里可以找到你的清单(和你的code的其余部分)或交换机新的结构,摇篮插件会看在错误的地方。

The default project structure has changed, so unless you either tell the Gradle plugin where to find your manifest (and the rest of your code) or switch to the new structure, the Gradle plugin will look in the wrong place.

在你的情况,它是在寻找货单的\\ src \\主\\ AndroidManifest.xml中,这是新的摇篮项目的默认。旧的项目结构(通过Eclipse的ADT +使用)放体现在项目的根在 \\ AndroidManifest.xml中

In your case, it is looking for the manifest at\src\main\AndroidManifest.xml, which is the default for new Gradle projects. The old project structure (used by Eclipse + ADT) puts the manifest in the root of your project at \AndroidManifest.xml.

您可以在您的build.gradle使用 sourceSets 封像这样指定的备用位置:

You can specify an alternate location in your build.gradle using a sourceSets closure like so:

android {
    // ...

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

        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
}

这将配置Android摇篮插件使用旧的项目结构为您的清单中,Java源代码和资源。

This will configure the Android Gradle plugin to use the old project structure for your manifest, Java sources, and resources.

如果您使用Android Studio的导入工具,它应该照顾所有这一切都为你。

If you use Android Studio's import tool, it should take care of all of this for you.

这篇关于:checkDebugManifest失败=>财产“清单”中指定的文件不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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