gpt4 book ai didi

android - 无法建立Android项目

转载 作者:行者123 更新时间:2023-12-02 10:48:14 25 4
gpt4 key购买 nike

我只是接手了一个没有任何文档的android项目,所以我的(第一)工作是要构建应用程序。

我正在使用Android Studio 1.5.1

我的构建输出如下所示:

AGPBI: {"kind":"error","text":"No resource found that matches the given name: attr \u0027stextColorLink\u0027.","sources":[{"file":"D:\\android\\jobmatch\\app\\src\\main\\res\\values\\styles.xml","position":{"startLine":47,"startColumn":4,"startOffset":2338,"endLine":54,"endColumn":12,"endOffset":2702}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"No resource found that matches the given name: attr \u0027stextSize\u0027.","sources":[{"file":"D:\\android\\jobmatch\\app\\src\\main\\res\\values\\styles.xml","position":{"startLine":47,"startColumn":4,"startOffset":2338,"endLine":54,"endColumn":12,"endOffset":2702}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"No resource found that matches the given name: attr \u0027stextStyle\u0027.","sources":[{"file":"D:\\android\\jobmatch\\app\\src\\main\\res\\values\\styles.xml","position":{"startLine":47,"startColumn":4,"startOffset":2338,"endLine":54,"endColumn":12,"endOffset":2702}}],"original":"","tool":"AAPT"}
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\tr\AppData\Local\Android\sdk\build-tools\23.0.3\aapt.exe'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output

我没有包括所有错误,因为它会持续发生与缺少attr资源有关的类似错误。

我的gradle文件如下所示:
apply plugin: 'com.android.application'

android {
compileSdkVersion 'Google Inc.:Google APIs:23'
buildToolsVersion "23.0.3"

defaultConfig {
applicationId "com.appchance.jobmatcher"
minSdkVersion 14
targetSdkVersion 21
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}

dependencies {
compile 'com.android.support:support-v4:21.0.3'
compile files('libs/android-support-v7-recyclerview.jar')
compile files('libs/crashlytics.jar')
compile files('libs/httpmime-4.1.2.jar')
compile files('libs/listviewanimations_lib-core-slh_3.1.0.jar')
compile files('libs/listviewanimations_lib-core_3.1.0.jar')
compile files('libs/listviewanimations_lib-manipulation_3.1.0.jar')
compile files('libs/systembartint-1.0.4.jar')
compile 'com.android.support:appcompat-v7:+'
}

Style.xml:
<resources xmlns:android="http://schemas.android.com/apk/res/android">

<style name="AppTheme" parent="AppTheme.Base" />

<style name="AppTheme.Translucent" parent="AppTheme.Base">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
</style>

<style name="AppTheme.Base" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:colorForeground">@color/colorForeground</item>
<item name="android:listChoiceIndicatorMultiple">@drawable/selector_check_box_empty</item>
<item name="android:listChoiceIndicatorSingle">@drawable/selector_check_box_empty</item>
<item name="actionMenuTextColor">@color/white</item>
<item name="android:actionMenuTextColor">@color/white</item>
<item name="sswitchStyle">@style/SwitchCustom</item>
</style>

<style name="ActionBarThemeOverlay" parent="">
<item name="android:textColorPrimary">#fff</item>
<item name="colorControlNormal">#fff</item>
<item name="colorControlHighlight">#8fff</item>
<item name="selectableItemBackground">@drawable/ab_item_background</item>
</style>

<style name="CustomSwitchTextAppearance" parent="TextAppearance.AppCompat.Widget.Switch">
<item name="android:textColor">@color/white</item>
<item name="android:textStyle">bold</item>
<item name="android:textSize">11sp</item>
</style>

<style name="SwitchCustom">
<item name="strack">@drawable/custom_switch_track</item>
<item name="sthumb">@drawable/custom_switch_thumb</item>
<item name="stextOn">@string/textOn</item>
<item name="stextOff">@string/textOff</item>
<item name="sthumbTextPadding">6dip</item>
<item name="sswitchMinWidth">60dip</item>
<item name="sswitchPadding">0dip</item>
<item name="sswitchTextAppearance">@style/TextAppearanceSwitch</item>
</style>

<style name="TextAppearanceSwitch">
<item name="stextColor">@color/white</item>
<item name="stextColorHighlight">@color/white</item>
<item name="stextColorHint">@color/white</item>
<item name="stextColorLink">@color/white</item>
<item name="stextSize">11sp</item>
<item name="stextStyle">1</item>
</style>

</resources>

我已经寻找了一种解决方案,但找不到解决方案,希望有人可以给我一些指示,因为我是android开发的新手。

最佳答案

1>清理项目并运行

(如果不是)

2>处理添加到build.gradle文件

dexOptions {
javaMaxHeapSize "4g"
}

关于android - 无法建立Android项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37165931/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com