Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/225.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 错误:资源android:style/TextAppearance.Material.Widget.Button.Borderless.Colored未找到_Java_Android - Fatal编程技术网

Java 错误:资源android:style/TextAppearance.Material.Widget.Button.Borderless.Colored未找到

Java 错误:资源android:style/TextAppearance.Material.Widget.Button.Borderless.Colored未找到,java,android,Java,Android,我正在尝试构建一个包含compileSdkVersion 25和targetSdkVersion 25的项目,但我需要将两者都更改为23,因此在更改compileSdkVersion 23和targetSdkVersion 23后,我会收到一个错误 错误:资源 android:style/TextAppearance.Material.Widget.Button.Borderless.Colored 没有找到。错误:资源 android:style/TextAppearance.Material

我正在尝试构建一个包含compileSdkVersion 25和targetSdkVersion 25的项目,但我需要将两者都更改为23,因此在更改compileSdkVersion 23和targetSdkVersion 23后,我会收到一个错误

错误:资源 android:style/TextAppearance.Material.Widget.Button.Borderless.Colored 没有找到。错误:资源 android:style/TextAppearance.Material.Widget.Button.Colored未找到。 错误:链接引用失败。 错误:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception:aapt2错误:检查日志中的 详细信息错误:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception:aapt2错误:检查日志中的 详细信息错误:com.android.tools.aapt2.aapt2异常:aapt2错误: 检查日志了解详细信息错误:任务执行失败 “:app:processDebugResources”

无法执行aapt

我是一名iOS开发人员,在Android方面没有太多经验,我无法找到代码中的错误点以及如何修复

编辑:1

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '26.0.2'
    defaultConfig {
        applicationId 'com.abc.app'
        minSdkVersion 21
        targetSdkVersion 23
        versionCode 4
        versionName '1.3'
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        buildConfigField("String", "API_KEY", "\"empty\"")
        //buildConfigField("String", "API_KEY", API_KEY)
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
        exclude 'META-INF/services/com.fasterxml.jackson.core.ObjectCodec'
        exclude 'META-INF/services/com.fasterxml.jackson.core.JsonFactory'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation 'com.wang.avi:library:2.1.3'
    implementation 'com.android.support:appcompat-v7:25.4.0'
    implementation 'com.android.support:customtabs:25.4.0'
    implementation 'com.android.support:cardview-v7:25.4.0'
    implementation 'com.nex3z:toggle-button-group:1.1.2'
    implementation 'com.github.ivbaranov:materialfavoritebutton:0.1.4'
    implementation 'com.android.support:design:25.4.0'
    implementation 'com.android.volley:volley:1.0.0'
    implementation 'com.github.PhilJay:MPAndroidChart:v3.0.2'
    implementation 'com.yqritc:recyclerview-flexibledivider:1.2.9'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.google.code.gson:gson:2.8.1'
    implementation 'com.github.bumptech.glide:glide:4.3.1'
    implementation 'com.google.android.gms:play-services-ads:11.8.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.3.1'
    implementation('com.github.fcopardo:easyrest:v1.4.2@aar') {
        transitive = true
    }
    //    compile 'com.github.wrdlbrnft:sorted-list-adapter:0.3.0.27'
    testImplementation 'junit:junit:4.12'
}

android:style/TextAppearance.Material.Widget.Button.Borderless.Colored是在API 24中添加的,所以您不能在版本23中使用它。可以使用在版本23之前添加的样式。您还可以将新样式应用于更新版本的设备,并将旧样式应用为默认样式:

已添加03/20/'18 12:32

由于您不熟悉Android,一个简单的解决方案是只使用较旧的文本外观。这至少可以让应用程序在你的Android 5设备上运行。之后,您可以了解如何进一步定制TextView,但现在让我们让它发挥作用

  • 可以为布局文件中的某个文本视图设置文本外观,该布局文件位于[something]/res/layout/xxx.xml,“布局”也可以是“layout xxx”
  • 它可以在位于[something]/res/values/styles.xml的样式文件中设置,“values”也可以是“values xxx” 在Android Studio的项目树中可以很容易地找到文件夹“res”。
    您还可以使用Ctrl+Shift+F在整个项目中进行搜索。
    找到它后,只需删除或注释该行。

    检查“style.xml”文件&您会看到错误突出显示。在以下内容中更改应用程序主题颜色:

    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
    
    
    
    问题: android 26或更高版本支持colorError,该软件包在23上,但该软件包可能在较低版本中

    解决方案:

    在build.gradle中添加以下代码。 将此放置在所有项目中{

    // force libs to use recent buildtools
    // https://github.com/luggit/react-native-config/issues/299
    subprojects {
        afterEvaluate {
            project ->
                if (project.hasProperty("android")) {
                    android {
                        compileSdkVersion = 27
                        buildToolsVersion = "27.0.3"
                    }
                }
        }
    }
    

    是的,我也想到了这一点,但问题是如何找到编写代码的地方,因为代码不是我写的,我不知道。你可以发布build.gradle..,检查支持库版本吗,通常你必须使用相同的版本编辑问题和构建。gradle added我也有这个问题,即使我使用28.with
    compileSdkVersion
    和Android支持库的版本(
    v4
    v7
    之类)都高于api 24?为什么要更改为version
    23
    ?我尝试了各种解决方法,但只对我有所帮助。如果您是因为react本机项目而来,请检查[此]()由于此问题,DJI UX SDK要求>=24。但由于附带的ffmpeg 0x86库无法处理SDK>23,因此无法编译。显然,DJI UX SDK需要重写,并且支持的mpeg库需要升级。