简体   繁体   中英

Android Custom Alert Dialog Error after updating android sdk r12

I got the following error after updating my android sdk revision to r12.

error: Error retrieving parent for item: No resource found that matches the given name '@android:style/AlertDialog'.

Here is my xml file.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="CustomDialogTheme" parent="@android:style/AlertDialog">
        <item name="android:windowFrame">@null</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:backgroundDimEnabled">true</item>
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowAnimationStyle">@android:style/Theme.Dialog</item>
    </style>
</resources>

I didn't change anything in the code and the only thing that I did was upgraded the Android SDK.

android:style/AlertDialog is not a public style and you should not use it. Please refer to this thread How to change theme for AlertDialog

Finaly i found the answer . i know its not the proper way but it works for now.

I managed to fix it by replacing the platform-tools_r06 with platform-
tools_r05 in android sdk folder

you can dowload platform-tools-r05 from here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM