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

如何解决Android Studio在找不到项目清单文件时出现的错误?

帅银龙
2023-03-14

我正在将我的遗留项目从Eclipse迁移到Android Studio。我做了以下事情:

  • 在eclipse中导出并生成gradle构建文件
  • 导入渐变。在Android Studio中生成文件
  • 将我的gradle版本依赖项更改为:classpath'com.Android工具。构建:梯度:0.9。”

该项目的“我的根文件夹”包含3个库项目:Actionbarsherlock、Authbahn和library。我的根文件夹还包含名为JohelpenHulpverlener的主项目。

解决了许多错误后,我得到以下错误:

Error:A problem was found with the configuration of task ':checkDebugManifest'.
> File 'C:\android\jeugdformaat\JohelpenHulpverlener\AndroidManifest.xml' specified for property 'manifest' does not exist.

我的根构建。gradle看起来像这样:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.9.+'
    }
}

apply plugin: 'android'

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

android {
    compileSdkVersion 17
    buildToolsVersion "19.0.3"

    defaultConfig {
        minSdkVersion 10
        targetSdkVersion 19
    }

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

我的身材。主项目中的gradle如下所示:

apply plugin: 'android'

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile project(':library')
    compile project(':actionbarsherlock')
    compile project(':autobahn')
}

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.0"

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

        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the main source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}

我正在努力理解这一点,希望有人能在这里帮助我!

共有3个答案

呼延学
2023-03-14

内置的。gradle文件指定包名,如

android {
compileSdkVersion 19
buildToolsVersion "20.0.0"


defaultConfig {
    applicationId "com.myapp"
    minSdkVersion 11
    targetSdkVersion 19
    versionCode 27
    versionName "1.5.6"
}
}

这里的com.myapp是我的应用程序的包名。我希望这对你有帮助。

商棋
2023-03-14

确保外部有如下标签:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example"
    android:versionCode="1"
    android:versionName="1.0" >

    ...

</manifest>
乐正焕
2023-03-14

在你的根级Gradle构建文件中有一堆东西,这使得构建系统认为那里有一个Android模块(不是;它是JohelpenHulpverlener内的一个子目录),并且它失败了,因为它找不到清单。

我认为如果你从你的根级别构建中提取很多东西。gradle文件,并将其替换为新项目的默认版本,即:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.9.+'
    }
}

allprojects {
    repositories {
        mavenCentral()
    }
}

它会起作用的。

 类似资料:
  • 我正在尝试用从本地文件解析。但我的IDE找不到这个文件。 项目结构: 下面是我的代码: 我该怎么修好它? 附注:将目录名从更改为。

  • 我试图从一个名为poll.txt的文件中获取数据集,然后使用相关数据。 poll.txt内容: 源代码,选举票.java: 但是,当我运行程序时,在给出异常之前,只使用了其中一行: 我试着在“scanner.nextLine();”语句中移动,但没有用。如果我不要求nextLine,这个程序运行良好,但我显然需要它,而且我似乎不知道出了什么问题。

  • 本文向大家介绍解决springboot项目上传文件出现临时文件目录为空的问题,包括了解决springboot项目上传文件出现临时文件目录为空的问题的使用技巧和注意事项,需要的朋友参考一下 最近写文件上传到服务器读取的代码,前端使用FormData上传,服务端用MultipartFile接收,自己测试了下MultipartFile对象有什么东西,结果一般属性都能出来,测试getInputStrea(

  • 我转换我的项目在maven.后我得到错误的标签.我提到在下面我得到了错误.我正在使用java 1.8, Spring4和Hibernate5如何配置这个pom.xml 错误细节是 生成过程中发生错误。在项目Spring_Hibernate_MVC上运行生成器Maven Project Builder时出错。无法计算构建计划:插件org.apache.maven.plugins: maven-res

  • 本文向大家介绍解决vue项目 build之后资源文件找不到的问题,包括了解决vue项目 build之后资源文件找不到的问题的使用技巧和注意事项,需要的朋友参考一下 解决静态资源失效的问题 这就需要修改我们的 config 中的 index.js了,默认的build 中的部分是这样的: 修改之后的应为这样的: 但是这样能确保资源文件可被正常找到, 但页面还是处于白屏状态, 在路由页面找到mode:

  • 我在Eclipse的一个JPA项目中工作。我使用:Hibernate、JavaFX和jOOQ,我将使用Jasper。在Eclipse上,项目正常运行,但是当我想要导出一个可运行的jar并尝试执行时,jar就会抛出异常。 我认为这可能是因为在jar文件中找不到可运行文件。如何使可运行的jar文件找到persistence.xml文件? 简而言之,我如何像在Eclipse中一样运行可运行的jar文件?