Ömer Bayram
Ömer Bayram

Reputation: 35

Fraction types not allowed

I'm creating an Android Application with Android Studio 2.2.3 and I can't understand why I'm getting this error message:

Error:(336, 49) Fraction types not allowed (at 'abc_dialog_fixed_height_major' with value '80%').

It's the generated file:

...\app\build\intermediates\res\merged\debug\values\values.xml

With this lines:

...
<dimen name="abc_control_inset_material">4dp</dimen>
<dimen name="abc_control_padding_material">4dp</dimen>
<dimen name="abc_dialog_fixed_height_major">80%</dimen>
<item name="abc_dialog_fixed_height_minor" type="dimen">100%</item>
<dimen name="abc_dialog_fixed_width_major">320dp</dimen>
...

My gradle file looks like this:

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
    applicationId "com.oe_ba.hadis"
    minSdkVersion 15
    targetSdkVersion 25
    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'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.google.code.gson:gson:2.7'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.android.support:cardview-v7:+'
compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
compile 'com.jakewharton.timber:timber:4.5.0'
compile 'com.afollestad.material-dialogs:core:0.9.2.3'
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
compile 'com.jenzz:materialpreference:1.3'
compile 'com.malinskiy:superrecyclerview:1.1.4'
testCompile 'junit:junit:4.12'
}

Upvotes: 3

Views: 1150

Answers (1)

Vadim Kotov
Vadim Kotov

Reputation: 8284

You should use item type="fraction" for percent values. You can find more info here.

Upvotes: 2

Related Questions