4

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

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Ravi
  • 34,851
  • 21
  • 122
  • 183
  • Removing `font` works fine? – Paresh P. Mar 22 '17 at 10:47
  • @Wizard yes, if i remove that, it works absolutely fine. – Ravi Mar 22 '17 at 10:48
  • Is there any build tools released for android O. If yes.. you should update it. because most of the weird issues yielded by build tools. – Paresh P. Mar 22 '17 at 10:57
  • I have updated whole SDK, but i don't know what should i write in `buildToolsVersion` and `targetSdkVersion`. Beacuase if i write `targetSdkVersion 0`, it shows error. – Ravi Mar 22 '17 at 11:00

3 Answers3

2

This setup worked for me:

compileSdkVersion 'android-O'
buildToolsVersion '26.0.0-rc1'
minSdkVersion 'O'
azizbekian
  • 60,783
  • 13
  • 169
  • 249
1

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.

Paresh P.
  • 6,677
  • 1
  • 14
  • 26
  • yes, thanks a lot for additional information, i was just doing experiments with latest version :) – Ravi Mar 22 '17 at 11:25
0

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

K.D.U
  • 21
  • 4
  • I think you need to check [this](https://developer.android.com/preview/features/working-with-fonts.html). – Ravi Mar 22 '17 at 10:43