Error:Execution failed for task ':app:processD

2019-05-07 03:57发布

I have updated SDK to Android O developer preview and started a simple demo with single TextView.

When i included font inside res folder it started showing me

Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

Here is my build.gradle

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        ...
        minSdkVersion 15
        targetSdkVersion 25
    }
}

Note : I am using Android Studio 2.4 Preview 3

If i remove font folder from res, everything works fine

enter image description here

3条回答
三岁会撩人
2楼-- · 2019-05-07 04:40

I got the reference from Android Official Documentation

Updating your gradle to -

android {
  compileSdkVersion 'android-O'
  buildToolsVersion '26.0.0-rc1'

  defaultConfig {
    targetSdkVersion 'O'
  }
  ...
}

dependencies {
  compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
}

will going to be fix your all the problems!!

PS,
You cannot publish your app with this configuration. The "O" version is a provisional API level that is usable only for development and testing during the Android O Developer Preview. You must wait to publish your Android O changes until the final API level is released, and then update your configuration again at that time.

查看更多
在下西门庆
3楼-- · 2019-05-07 04:52

This setup worked for me:

compileSdkVersion 'android-O'
buildToolsVersion '26.0.0-rc1'
minSdkVersion 'O'
查看更多
神经病院院长
4楼-- · 2019-05-07 04:56

you have to make Assets Folder inside app and past your font into it and you have to register your font in Manifest file

查看更多
登录 后发表回答