Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details. ShareSDK 也有這種錯誤


Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details.
D:\GameDevelopment\adt-bundle-windows-x86\build-tools\android-4.4W\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "D:/GameDevelopment/adt-bundle-windows-x86/platforms/android-14\android.jar" -F bin/resources.ap_

 

http://answers.unity3d.com/questions/340592/android-build-woes.html

 

http://forum.unity3d.com/threads/failed-to-re-package-resources.123883/

使用了別人的接口代碼 看看別人的Plugns目錄下的res 里 和自己Eclipse 工程下的res目錄里的相同XML 文件進行合並 不相同的拷貝進來。

 

stderr[
res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
]

因為新建Android項目自動引用了appcompat_v7  Libraries  生成了 values-v11 和 values-v14文件夾 

 values 文件夾 下的style.xml

<resources>

    <!--
        Base application theme, dependent on API level. This theme is replaced
        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
    -->
    <style name="AppBaseTheme" parent="Theme.AppCompat.Light">
        <!--
            Theme customizations available in newer API levels can go in
            res/values-vXX/styles.xml, while customizations related to
            backward-compatibility can go here.
        -->
    </style>

    <!-- Application theme. -->
    <style name="AppTheme" parent="AppBaseTheme">
        <!-- All customizations that are NOT specific to a particular API-level can go here. -->
    </style>

</resources>

 

 values-v11 文件夾 下的style.xml

<resources>

    <!--
        Base application theme for API 11+. This theme completely replaces
        AppBaseTheme from res/values/styles.xml on API 11+ devices.
    -->
    <style name="AppBaseTheme" parent="Theme.AppCompat.Light">
        <!-- API 11 theme customizations can go here. -->
    </style>

</resources>

 

 values-v14 文件夾 下的style.xml

<resources>

    <!--
        Base application theme for API 14+. This theme completely replaces
        AppBaseTheme from BOTH res/values/styles.xml and
        res/values-v11/styles.xml on API 14+ devices.
    -->
    <style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- API 14 theme customizations can go here. -->
    </style>

</resources>

 

要么 引入android-support-v4.jar  和 android-support-v7-appcompat.jar  appcompat_v7.jar  右鍵 Add to build Path 應該就沒問題

 

或者去掉引用把style.xml 里的 appCompat.Light 換成

<style name="AppBaseTheme" parent="android:Theme.Light"></style>

 

 

貌似這篇文章是解決方法:

http://blog.csdn.net/heirenheiren/article/details/7518596

http://zhidao.baidu.com/link?url=oBPfktDVuYf8NBl0-qvAgzPVt-XC0jt56-N-K4Fryc58DmgLya3fYb_1Il2NAOFu_RbHQQSZBcy8pgVgfdcyDvdGEgcvAFUVh-bkxzHJXA_

創建一個項目,還沒有動它就有錯
res中styles.xml里 <style name="AppBaseTheme" parent="Theme.AppCompat.Light">
錯誤Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
而且還沒有R.java MainActivity里面的錯誤更多。
請大神幫助!!謝謝……
 
2014-03-28 18:36提問者采納
 
android版本問題,你把<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
錯誤Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.這段刪掉,再build,這樣R文件應該能生成




http://blog.csdn.net/jiadebin890724/article/details/25166045

1、導入某個現有工程文件夾后,出現R資源不能resolve的錯誤,導致程序無法編譯運行,此時右鍵->properties->android,看最上面的taget又沒有選擇對,勾選當前可選的最高那個版本(即你本機已經安裝的最高版本的SDK),點擊apply,錯誤解決。

 

2、style.xml里出現樣式無法識別:

error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.

也包括其他樣式的此類錯誤,是因為:



8down voteaccepted

AppCompat is a library project. You need to reference the library project in your android project.

https://developer.android.com/tools/support-library/setup.html

Check the topic Adding libraries with resources.

去這個地址看解決方法吧。

 

 

參考我的另一篇博文:

點擊打開鏈接

 

3、Activity中使用addContentView(layoutPlatform, lpLl);方法動態添加了一個子view,layoutPlatform是LinearLayout類型的,作為view,我想在layoutPlatform這個子view里與Activity通信,即在子view里點擊某個按鈕之后,讓Activity更新界面內容,這個實現方法是,在Activity中實現CallBack借口,重寫它的handleMessage方法,然后在子view的按鈕點擊處理函數里給Activity發送message即可。

發送消息的方式是 handler.sendMessage();

 

<style name="AppBaseTheme" parent="android:Theme.Light">

http://blog.csdn.net/lan120576664/article/details/34952877

http://blog.csdn.net/lan120576664/article/details/34952877
http://blog.csdn.net/comeonmyideal/article/details/8126186
http://stackoverflow.com/questions/18631643/no-resource-found-that-matches-the-given-name-androidtheme-holo-light
http://blog.csdn.net/yony2011/article/details/8441240 第3步貌似可以解決
http://blog.csdn.net/lincyang/article/details/21040489
http://www.linuxine.com/story/no-resource-found-matches-given-name-stylethemeappcompatlight 這個也ok 待測試
<style name="CustomActionBarTheme" parent="@android:style/Theme.AppCompat"> <item name="android:actionBarStyle">@style/MyActionBar</item> </style>

http://dreamisx.blog.163.com/blog/static/1150048392012112024649308/

3. 錯誤的復原

若是我們原有的專案於建立的時候,  Build SDK 為 API 16 ,以及 Minimum Required SDK 是 API 8,在之前沒有去更動資源的狀況,且如上述有 Android API 8 的環境下匯入存在的專案時,會發生如上圖中,專案前的圖示有錯誤圖示,而在 Problems視窗 會看到下列兩個錯誤訊息:

  1. Description Resource Path Location Type error:
    Error retrieving parent for item: No resource found that matches the given name‘android:Theme.Holo.Light.DarkActionBar’. styles.xml
  2. Description Resource Path Location Type error:
    Error retrieving parent for item: No resource found that matches the given name‘android:Theme.Holo.Light’. styles.xml

這個狀況是因為,在建立 API 16 時,系統會為我們自動新增 values-v11 以及 values-v14 這兩個分別是 API 11 以及 API 14 的資源目錄,所以在 API 8 為核心的狀況下,系統是不認得他的。而解決方式有二:

  1. 直接刪除掉這兩個用不到的資源目錄。
  2. 更改核心:在專案名稱上點擊滑鼠右鍵,選擇 Properties 再選到左側列表的 Android 選項,可以看到如下的畫面,
Change Android Project Build Target

變更 Project Build Target

這時候,勾選 Android 4.1 或是 Google APIs (API Level 16) 的版本;接著再點擊工具列的Project > Clean 選擇該專案,讓 R.java 重建即可。

而這個動作要注意到 Project > Build Automatically 是否有被勾選,否則,系統只會很單純地幫我們把 R.java 清掉而已。

Build Automatically

Build Automatically 在執行 Clean 之後,會再自動產生 R.java


http://www.myexception.cn/android/1080428.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



猜您在找 Unity2D接入GG廣告在發布安卓版本時報錯CommandInvokationFailure: Failed to re-package resources解決方法 異常:Error:Execution failed for task ':app:compileDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details. Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details. Restarting network (via systemctl): Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details. linux----------啟動network的時候報錯Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details. DOCKER啟動失敗Job for docker.service failed because the control process exited with error code. See "syste mctl status docker.service" and "journalctl -xe" for details. docker 報錯: Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details. docker 啟動失敗 Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details. Job for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xe" for details. Job for rabbitmq-server.service failed because the control process exited with error code. See "systemctl status rabbitmq-server.service" and "journalctl -xe" for details.
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM