2014-03-13 40 views
2

根據Google Analytics documentation。線下必須加入,但日食不會編譯,因爲「冗長」不是布爾錯誤:字符串類型不允許('ga_logLevel'值'詳細')

<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> 
+0

如果將ga_logLevel更改爲「string」資源而不是「bool」,會發生什麼情況。這可能記錄不正確。 –

回答

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> 
相關問題