錯誤一
錯誤描述:android.view.InflateException: Binary XML file line #33: Error inflating class fragment
錯誤原因:類庫不支持
解決方法:
- fragment導(dǎo)入android.support.v4.app.Fragment和android.support.v4.app.FragmentTransaction;
- activity繼承FragmentActivity
錯誤二
錯誤描述:Error:Execution failed for task ':schoolpa:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/maven/com.belerweb/pinyin4j/pom.properties
錯誤原因:jar包重復(fù)
解決方法:
第一步:項(xiàng)目gradle-android節(jié)點(diǎn)下增加以下屬性
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/maven/com.belerweb/pinyin4j/pom.xml'
exclude 'META-INF/maven/com.belerweb/pinyin4j/pom.properties'
}
dexOptions {
javaMaxHeapSize "4g" //specify the heap size for the dex process
preDexLibraries = false //delete the already predexed libraries
}第二步:同步項(xiàng)目均唉,clean項(xiàng)目,rebuild項(xiàng)目琉挖,運(yùn)行項(xiàng)目即可
錯誤三
錯誤描述:No tab content FrameLayout found for id xxx
錯誤原因:未知
解決方法:
- 刪掉xml中的Tabwidget
錯誤四
錯誤描述:
DELETE_FAILED_INTERNAL_ERROR
Error while Installing APKs
錯誤原因:未知
解決方法:
- clean項(xiàng)目贩挣,rebuild項(xiàng)目,運(yùn)行項(xiàng)目即可
錯誤五
錯誤描述:
錯誤原因:未知
解決方法(慎重使用):
defaultConfig {
minSdkVersion 14
targetSdkVersion 21
multiDexEnabled true
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
}
錯誤六
錯誤描述:
Error:Conflict with dependency 'com.google.code.findbugs:jsr305'. Resolved versions for app (1.3.9) and test app (2.0.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details.
錯誤原因:未知
解決方法:
android {
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
}