记录Android Studio中的一些错误,以及解决方案~

Manifest merger failed with multiple errors

错误详情

Information:Gradle tasks [:app:generateWandoujiaReleaseSources, :app:prepareWandoujiaReleaseUnitTestDependencies, :app:mockableAndroidJar]
Error:Execution failed for task ':app:processWandoujiaReleaseManifest'.
Manifest merger failed with multiple errors, see logs

pic

解决方案

在AndroidManifest.xml的application节点下,添加这句tools:replace=”…“, 参考Android Studio使用心得 - 常见问题集锦

tools:replace="android:allowBackup, android:theme, android:icon, android:label, android:supportsRtl"

//完整的
<application
	android:allowBackup="false"
    android:icon="@mipmap/ic_launcher"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="false"
    android:theme="@style/AppTheme"
    tools:replace="android:allowBackup, android:theme, android:icon, android:label, android:supportsRtl">

	// ...

</application>

使用Rxjava 跟CompileSdkVersion冲突, 导致4.0手机崩溃的问题。

参考文章:https://stackoverflow.com/questions/37619596/rxjava-noclassdeffounderror-rx-plugins-rxjavaplugins-on-api-16

接入一个SDK后,方法数超标了。 所以Rxjava中的各种类找不着…继承MultiDexApplication解决问题。

compile 'com.android.support:multidex:1.0.1'
In thread: Thread[main,5,main]                                                             
UncaughtException detected: java.lang.NoClassDefFoundError: rx.subscriptions.CompositeSubscription

Gralde Failed to open zip file

错误详情

pic

解决方案

指定正确的gradle路径。

pic

Error:Execution failed for task ‘:app:transformClassesWithExtractJarsForDebug’.

错误详情

pic

解决方案

关掉instant run之后解决

Intellij Class JavaLaunchHelper is implemented in two places

错误详情

objc[3648]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java (0x10d19c4c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x10ea194e0). One of the two will be used. Which one is undefined.

解决方案

进入IDE,Help –> Eidt Custom Properties, 在idea.properties中加入下面这句,然后重启IDE即可。

idea.no.launcher=true

Stack overflow : https://stackoverflow.com/questions/43003012/class-javalaunchhelper-is-implemented-in-two-places/43003231#43003231


分享到