將今后遇到的問題與解決方案评甜,都統(tǒng)一記錄一下灰粮。
第一
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest.xml:14:9-43
is also present at [com.pnikosis:materialish-progress:1.0] AndroidManifest.xml:13:9-45 value=(@drawable/ic_launcher).
Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml:11:5-41:19 to override.
解決方案:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" 這里加上這一句
<application tools:replace="Android:icon, android:theme"
在Application中加上這一句,重新編譯一下就可以了
第二
java.lang.IncompatibleClassChangeError: adapters.newsadapter.NewsPagerAdapter
這個IncompatibleClassChangeError忍坷,是導入的包有問題粘舟,所以要檢查 自己導入的包
這里我將項目中添加的這句:
configurations { all*.exclude group: 'com.android.support', module: 'support-v4' }
去除掉,就可以用了佩研。 原因我也不知道~~
第三
Android Studio出現(xiàn)Read Timed out
我的Android Studio版本為3.1.2柑肴,在打開Demo的時候報了這個錯,然后網(wǎng)上找了一圈旬薯。也不能像網(wǎng)上那些說改SDK和JDK之類的晰骑。
然后查看這個Demo中是否使用了Kotlin,然后是否版本導入錯了,修改過來就行
image.png
這里我將Kotlin的版本按照提示改成了1.2.30硕舆,然后重新編譯秽荞,就行了。
ps:如果重新編譯還是一樣Read Timed out抚官,那么就把這個Demo項目關掉扬跋,重新打開。應該就可以了凌节!