错误:不允许使用字符串类型(在'ga_logLevel'中,值为'verbose')

时间:2014-03-13 22:04:49

标签: android google-analytics

根据Google Analytics documentation。必须添加下面的行,但是eclipse不能编译,因为'verbose'不是bool

<bool name="ga_logLevel">verbose</bool>

任何人都知道如何解决这个问题?

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="https://schemas.android.com/tools" tools:ignore="TypographyDashes">

    <!-- Replace placeholder ID with your tracking ID -->
    <string name="ga_trackingId">XXXXXX</string>

    <!-- Enable Activity tracking -->
    <bool name="ga_autoActivityTracking">true</bool>

    <!-- Enable automatic exception tracking -->
    <bool name="ga_reportUncaughtExceptions">true</bool>
    <!-- <bool name="ga_debug">false</bool> -->
    <bool name="ga_logLevel">verbose</bool>

</resources>

1 个答案:

答案 0 :(得分:2)

您必须将ga_logLevel声明为字符串。

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="https://schemas.android.com/tools" tools:ignore="TypographyDashes">

    <!-- Replace placeholder ID with your tracking ID -->
    <string name="ga_trackingId">XXXXXX</string>

    <!-- Enable Activity tracking -->
    <bool name="ga_autoActivityTracking">true</bool>

    <!-- Enable automatic exception tracking -->
    <bool name="ga_reportUncaughtExceptions">true</bool>
    <!-- <bool name="ga_debug">false</bool> -->
    <string name="ga_logLevel">verbose</string>

</resources>