Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.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
Android Support Library 26.0.0-beta2中的字体:错误:prolog中不允许包含内容_Android_Fonts - Fatal编程技术网

Android Support Library 26.0.0-beta2中的字体:错误:prolog中不允许包含内容

Android Support Library 26.0.0-beta2中的字体:错误:prolog中不允许包含内容,android,fonts,Android,Fonts,我正在尝试使用新功能,直接将字体添加到xml中,但运气不好 我为26.0.0-beta2支持库设置了我的项目,在res文件夹中创建了font资源文件夹,复制了一些字体到其中,当尝试构建它时,我收到错误:prolog中不允许内容。消息 结构如下: “我的应用程序”build.gradle没有什么特别之处: buildscript { repositories { jcenter() } dependencies { classpath 'c

我正在尝试使用新功能,直接将字体添加到xml中,但运气不好

我为26.0.0-beta2支持库设置了我的项目,在
res
文件夹中创建了
font
资源文件夹,复制了一些字体到其中,当尝试构建它时,我收到错误:prolog中不允许内容。消息

结构如下:

“我的应用程序”
build.gradle
没有什么特别之处:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.2'
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}

ext {
    supportLibVersion = '26.0.0-beta2'
    constraintLayout = '1.0.2'
    playServicesVersion = '10.2.6'
    butterknifeVersion = '8.0.1'
    stethoVersion = '1.5.0'
    realmStethoVersion = '2.0.0'
    daggerVersion = '2.11'
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
我的模块的
build.gradle
是:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId "com.test.myproject"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
        exclude module: 'jsr305'
    })

    compile "com.android.support:support-core-utils:$supportLibVersion"
    compile "com.android.support:appcompat-v7:$supportLibVersion"

    //ConstrainLayout
    compile "com.android.support.constraint:constraint-layout:$constraintLayout"

    //Dager2
    compile "com.google.dagger:dagger-android:$daggerVersion"
    compile "com.google.dagger:dagger-android-support:$daggerVersion"
    annotationProcessor "com.google.dagger:dagger-android-processor:$daggerVersion"

    testCompile 'junit:junit:4.12'
}   
我在某个地方读到,暂时将字体移动到项目之外的某个地方,进行重建,然后再将其移回,就足够了,但这不起作用,我再次收到了这条消息。我做错了什么


谢谢

要使用这些新功能,您必须更新
classpath'com.android.tools.build:gradle:
到3.0.0-alpha1至少

要使用这些新功能,您必须更新
classpath'com.android.tools.build:gradle:
至少到3.0.0-alpha1