Android Studio异常:Manifest merger failed with multip/Unable to start the daemon process

原创 2015年06月02日 13:42:42

1.Manifest merger failed with multiple errors, see logs

AS的Gradle插件默认会启用Manifest Merger Tool,若Library项目中也定义了与主项目相同的属性(例如默认生成的Android:icon和android:theme),则此时会合并失败,并报上面的错误。解决方法:

1)在Manifest.xml的<manifest根标签上加入xmlns:tools="http://schemas.android.com/tools"否则会找不到namespace

2)在Manifest.xml的<application标签下添加tools:replace="android:icon, android:theme"(多个属性用,隔开)


2.Error:Unable to start the daemon process

Error:Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at http://gradle.org/docs/1.12/userguide/gradle_daemon.html
Please read below process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

AS启动APP异常解决办法:

1)ADB已经停止

启动任务管理器->

进程->关闭相关端口占用程序 如:豌豆荚、360等

2)当前用户的.gradle文件夹下:C:\Users\Administrator\.gradle 设置gradle.properties,若无就新增文件,添加配置信息:org.gradle.jvmargs=-Xmx512m 

如果还是不行,有可能是同时开了eclipse和AS,关闭eclipse和模拟器并用真机试一下就可以了。


3.Information:Gradle tasks [:app:assembleDebug] Error:

Execution failed for task ':app:transformClassesWithJarMergingForDebug'

> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command'C:\Program Files (x86)\Java\jdk1.7.0_13\bin\java.exe''finished withnon-zero exitvalue2

方法defaultConfig {
        multiDexEnabled true //忽略方法数重复引用
        targetSdkVersion 21
        minSdkVersion 15
    }

> com.android.build.api.transform.TransformException: java.util.zip.ZipException: 

duplicate entry: android/support/annotation/IntegerRes.class

上面为support-v4重复,方法compile 'com.android.support:support-v4:23.0.0' 改为provided 'com.android.support:support-v4:23.0.0'
使用provided必须删除compile fileTree(include: ['*.jar'], dir: 'libs')

>Error: File path too long on Windows, keep below 240 characters :图片路径过长等相关错误

android {
    compileSdkVersion 23
    aaptOptions.cruncherEnabled = false//取消图片限制
    aaptOptions.useNewCruncher false;//取消图片限制
}
4.java.lang.NoClassDefFoundError:xxx

方法:超过6万方法数,将工程中的Application类让它继承android.support.multidex.MultiDexApplication或者复写Application的attachBaseContext方法:

        @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }


5.java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/com.example.xxx-1/lib/arm/libxxx.so: has text relocations

方法:将libxxx.so文件targetSdkVersion版本降低,还是报错的话,建议继续降低版本或者尝试将主工程与库工程so文件夹类型改为一致(armeabi…)


6.Cannot locate factory for objects of type DefaultGradleConnector, as ConnectorServiceRegistry has been closed.解决方法:重启AS


7.Duplicate files copied in APK

> Duplicate files copied in APK assets/uzmap/module.json
	File1: C:\Users\Administrator\Desktop\hjjc\app_hjjc\app\build\intermediates\res\resources-debug.ap_
	File2: C:\Users\Administrator\Desktop\hjjc\app_hjjc\app\build\intermediates\transforms\mergeJavaRes\debug\jars\2\1f\main.jar

方法:android {
packagingOptions{
        exclude 'assets/uzmap/module.json'
    }
}

gradle中途突然死机也会导致module不识别,删除工程的build文件夹重新run即可!!!


8.Android Studio utf-8编码设置 乱码

1)设置整个项目编码:菜单栏中的“File”->“Setting”,进入设置面板,选择“Editor” ->“File Encodings”:
将IDE Encoding”设为“UTF-8”,“Project Encoding”设为“UTF-8”,最下面的“Default encoding for properties files”也更改为“UTF-8”后面的复选框上打上对勾。
2)设置单个文件编码:在当前文件窗口点击右下角“UTF-8”或“GBK”编码字样,选择编码格式,弹窗后点击“Reload”按钮。

更多:Android studio打开闪退、打不开、卡死问题,新建配置文件\android-studio\bin\studio.exe.vmoptions 或Help->Edit Custom VM Options,或工程目录的.gradle gradle两个文件夹配置版本必须一致。

Android Studio强者之路

Google为Android Developer量身定做的一款IDE,很值得大家去学习,而本系列视频从浅到深,一步步带领大家完全掌握这款工具的使用!
  • 2016年07月31日 11:35

Android Studio Gradle 'XXX' project refresh failed:Unable to start the daemon process

solution: where I found the solution : An error when creating new project in android studio
  • Bossgirls
  • Bossgirls
  • 2013-11-21 17:39:43
  • 7444

Android Studio创建新项目出错Unable to start the daemon process.

问题: Failed to import new Gradle project: Could not fetch model of type 'IdeaProject' using Gradle d...
  • huangxr874668739
  • huangxr874668739
  • 2014-10-28 11:03:45
  • 2481

Android studio Unable to start the daemon process

在将AdroidStudio升级到版本2.2.2后出现: Error:Unable to start the daemon process. This problem might be caused...
  • w690333243
  • w690333243
  • 2017-02-09 16:46:22
  • 1316

Gradle sync failed: Unable to start the daemon process

开始学习adriod ,用的andriod studio ,启动项目出现 Gradle sync failed: Unable to start the daemon process 搜了一下 ...
  • cslie
  • cslie
  • 2016-03-18 16:09:55
  • 5997

Android Studio Gradle project sync failed,Gradle sync failed: Unable to start the daemon process.

Error:Unable to start the daemon process. This problem might be caused by incorrect configuration o...
  • qq_33161695
  • qq_33161695
  • 2017-06-22 20:26:42
  • 1465

AndroidStudio Unable to start the daemon process(无法启动Gradle守护进程)

Android Studio+Gradle安装完毕后无法正常创建工程,显示 Unable to start the daemon process.  This problem might be...
  • ching_zhi
  • ching_zhi
  • 2017-01-11 15:50:32
  • 10141

AndroidStudio升级到2.2版本以后发生错误Error:Unable to start the daemon process.

错误描述 新建工程或者打开已有工程出现以下错误: Error:Unable to start the daemon process. This problem might be caused b...
  • yishichangan1
  • yishichangan1
  • 2016-10-13 16:34:23
  • 1019

android studio Error:Unable to start the daemon process

我在用android studio 做一个小项目,在家里的mac电脑中创建项目,并同步到coding.net中。 到公司电脑中下拉此项目,并通过android studio打开,可打开后的项目报如下...
  • dhx20022889
  • dhx20022889
  • 2015-04-07 15:01:18
  • 36949

【已解决】Unable to start the daemon process

转自:http://blog.csdn.net/dhx20022889/article/details/44919905 我在用android studio 做一个小项目,在家里的mac电脑中创建...
  • qq_29266921
  • qq_29266921
  • 2015-11-30 15:44:31
  • 1277
收藏助手
不良信息举报
您举报文章:Android Studio异常:Manifest merger failed with multip/Unable to start the daemon process
举报原因:
原因补充:

(最多只允许输入30个字)