2016-05-13 135 views
1

我正嘗試在android studio中爲我的應用程序生成已簽名的apk文件。我能夠在更改一行代碼之前成功完成此操作,但出現錯誤。我更改的代碼行在strings.xml中。由於ResourceCycle錯誤,無法在Android Studio中生成apk文件

<resources> 
    <string name="app_name">Flashlight</string> 

    <string name="banner_ad_unit_id">ca-app-pub-3940256099942544/6300978111</string> 
</resources> 

<resources> 
    <string name="app_name">Flashlight</string> 

    <string name="banner_ad_unit_id">ca-app-pub-6203674096217868/4182598236</string> 
</resources> 

我所做的是AdMob的測試廣告的ID改成我真正的廣告ID。現在,我得到這個錯誤:

Error:Error: Style Resource definition cycle: TextAppearance.AppCompat.Light.SearchResult.Title => TextAppearance.AppCompat.SearchResult.Title => TextAppearance.AppCompat.SearchResult.Title [ResourceCycle] 
    Explanation for issues of type "ResourceCycle": 
    There should be no cycles in resource definitions as this can lead to 
    runtime exceptions. 

這裏是我的styles.xml文件:

<resources> 

    <!-- Base application theme. --> 
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> 
     <!-- Customize your theme here. --> 
     <item name="colorPrimary">@color/colorPrimary</item> 
     <item name="colorPrimaryDark">@color/colorPrimaryDark</item> 
     <item name="colorAccent">@color/colorAccent</item> 
    </style> 

    <style name="FullscreenTheme" parent="AppTheme"> 
     <item name="android:actionBarStyle">@style/FullscreenActionBarStyle</item> 
     <item name="android:windowActionBarOverlay">true</item> 
     <item name="android:windowBackground">@null</item> 
     <item name="metaButtonBarStyle">?android:attr/buttonBarStyle</item> 
     <item name="metaButtonBarButtonStyle">?android:attr/buttonBarButtonStyle</item> 
    </style> 

    <style name="FullscreenActionBarStyle" parent="Widget.AppCompat.ActionBar"> 
     <item name="android:background">@color/black_overlay</item> 
    </style> 

</resources> 

我感謝所有幫助我曾嘗試使用Google的錯誤,但無濟於事。

回答

2

我找到了解決我的問題的方法。這個問題我的應用程序文件內居住,我改變了

compile 'com.android.support:appcompat-v7:24.0.0-alpha1' 
compile 'com.android.support:support-v4:24.0.0-alpha1' 

compile 'com.android.support:support-v4:23.1.1' 
compile 'com.android.support:appcompat-v7:23.1.1' 
相關問題