开发环境:Android studio
错误:
Information:Gradle tasks [:lvcheappui:generateDebugSources, :lvcheappui:generateDebugAndroidTestSources]
:lvcheappui:preBuild UP-TO-DATE
:lvcheappui:preDebugBuild UP-TO-DATE
:lvcheappui:checkDebugManifest
:lvcheappui:preReleaseBuild UP-TO-DATE
:lvcheappui:prepareComAndroidSupportAppcompatV72200Library UP-TO-DATE
:lvcheappui:prepareComAndroidSupportSupportV42200Library UP-TO-DATE
:lvcheappui:prepareDebugDependencies
:lvcheappui:compileDebugAidl UP-TO-DATE
:lvcheappui:compileDebugRenderscript UP-TO-DATE
:lvcheappui:generateDebugBuildConfig UP-TO-DATE
:lvcheappui:generateDebugAssets UP-TO-DATE
:lvcheappui:mergeDebugAssets UP-TO-DATE
:lvcheappui:generateDebugResValues UP-TO-DATE
:lvcheappui:generateDebugResources UP-TO-DATE
:lvcheappui:mergeDebugResources
:lvcheappui:processDebugManifest UP-TO-DATE
:lvcheappui:processDebugResources
AGPBI: {"kind":"simple","text":"res\\drawable\\dx_new_bkg.png:0: error: Resource entry dx_new_bkg is already defined.","sources":[{}]}
AGPBI: {"kind":"simple","text":"res\\drawable\\dx_new_bkg.9.png:0: Originally defined here.","sources":[{}]}
AGPBI: {"kind":"error","text":"No resource identifier found for attribute \u0027footerColor\u0027 in package \u0027com.lvche.app\u0027",
"sources":[{"file":"D:\\AndroidSutdioWShop\\lvcheappui\\src\\main\\res\\layout\\activity_tabbar.xml","position":{"startLine":55}}],"original":""}
Error:Execution failed for task ':lvcheappui:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException:
Process 'command 'D:\android_latest\android-sdk-windows\build-tools\22.0.1\aapt.exe'' finished with non-zero exit value 1
Information:BUILD FAILED
Information:Total time: 1.613 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
原因出现提示:
AGPBI: {"kind":"simple","text":"res\\drawable\\dx_new_bkg.png:0: error: Resource entry dx_new_bkg is already defined.","sources":[{}]}
AGPBI: {"kind":"simple","text":"res\\drawable\\dx_new_bkg.9.png:0: Originally defined here.","sources":[{}]}
AGPBI: {"kind":"error","text":"No resource identifier found for attribute \u0027footerColor\u0027 in package \u0027com.lvche.app\u0027",
"sources":[{"file":"D:\\AndroidSutdioWShop\\lvcheappui\\src\\main\\res\\layout\\activity_tabbar.xml","position":{"startLine":55}}],"original":""}
解决方法:
可能方案:
1.资源命名不规范,例如layout.xml文件 应该小写,而没有,
2.资源文件出现了重复定义
3.检查下面这种引用前缀是否正确
xmlns:app="http://schemas.android.com/apk/com.lvche.app.incubator.ui.componennt.tabbarview.ui.TitleIndicator"
<com.lvche.app.incubator.ui.componennt.tabbarview.ui.TitleIndicator
xmlns:app="http://schemas.android.com/apk/com.lvche.app.incubator.ui.componennt.tabbarview.ui.TitleIndicator"
android:id="@+id/pagerindicator"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:background="#ffffff"
app:footerColor="@color/tab_indicator_text_selected"
app:footerLineHeight1="0dp"
app:footerTriangleHeight1="3.0dp"
app:textColor="@color/tab_indicator_text"
app:textSizeNormal="@dimen/common_text_size_middle_2"
app:textSizeSelected="@dimen/common_text_size_middle_2"
/>
4.堆栈配个最大值
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
def AAVersion = '3.3.1'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.lvche.app"
minSdkVersion 9
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
<strong><span style="color:#ff6666;">//最大堆处理
dexOptions {
incremental = true;
preDexLibraries = false
javaMaxHeapSize "4g" // 2g should be also OK
}</span></strong>
}
dependencies {
//compile fileTree(dir: 'libs', include: ['*.jar'])
apt "org.androidannotations:androidannotations:$AAVersion"
compile "org.androidannotations:androidannotations-api:$AAVersion"
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:support-v4:22.0.0'
}
apt {
arguments {
//老版本的写法2.2.1以前
//androidManifestFile variant.processResources.manifestFile
//2.2.1以后
androidManifestFile variant.outputs[0].processResources.manifestFile
resourcePackageName 'com.lvche.app'//项目包名
}
}
改了以上的可能性,还是没能解决,自己百度去吧~~~~