Quantcast
Channel: memento
Viewing all articles
Browse latest Browse all 14

「resources.ap_ does not exist」が出る

$
0
0
EclipseでAndroidアプリケーションを開発しているときに、不意にハマった現象。

もしかして:Eclipseのオプションで、Android > Build > Build output > Verbose にしていないか?
今回ハマった現象はこれで、ADT14のaaptが-vオプション有りで死ぬらしい。
https://code.google.com/p/android/issues/detail?id=20395 参照。

注:これを書いている時点でADT16がリリースされていたので、もう直ってるかも。

そうでなければ以下を参照。

stackoverflow.comの記事
http://stackoverflow.com/questions/4437023/resources-ap-does-not-exist-when-compile-my-android-project

他のマシンで動作するシンプルなサンプルでも、自分の環境では冒頭のエラーで実行出来ない症状。
いくつかのWorkaroundが存在する。

1. Project > Clean を実行する(いくつかの派生がある。Clean,Delete gen,restart eclipseとか)
2. 指摘された場所に「resources.ap_」という空ファイルを作成してClean/Rebuildする
3. 不正なリソースファイル(adbの認識出来ないPNGファイルとか)を削除する。ただしこの場合は別のエラーが出ているはず。
4. aaptをアップデートした際に、順序のない書式指定文字列をビルドエラーとして扱うようになった。
ちょっとややこしい。
This was my problem as well. Basically anywhere in your strings.xml where you have any combination of %s or %d in the same string, replace them with %1$s or %2$d where the number between the % and $ is the order in which they are placed in the string. For exmaple: "Blah %d something %s" should now be "Blah %1$d something %2$s"– GuyNoir Dec 26 '10 at 20:12
Oh, you did not mention that you upgraded to SDK v8 when you encountered the problem. Yes, the SDK is more strict now when it comes to ordering format strings. :) – Zarah Jan 9 at 18:06
It can't be, we can find this problem in android sdk examples, SearchableDictionary has this problem ._. – rubdottocom Feb 22 at 16:48
5. "gen"を消してからProject > Build All を実行して、R.javaを再生成する。
6. API-Levelが間違っている。正しいLevelを選択すればよい。
7. string.xmlに問題がある。最低限必要な分を残し、一回全部消してみる。
8. Admob adsを使っている場合に
1) I was using Admob ads, and I didn't have an attrs.xml file in my res/values folder
2) I deleted a line that says "import andriod.R" from my main activity, and all my resources connected again and this ultimately made the error go away.
3) The last thing I had wrong is I had a "lib" folder instead of a "libs" folder that held my Admob jar file.
Lastly, I cleaned the project after these changes.
9. (Alt-Shift-Q then X)でなんかでてくる?他にもConsoleのproblemログをきちんと確認する。(異常なリソースファイルとかはこれでわかるかも)
結構9patchで問題が出ている場合が多いっぽい。作り方の問題か?
10. バックスラッシュをstrings.xmlに含んでいる
11. アップデート時に問題が出た場合、プロジェクトのバックアップから復元し直してみることで治るかもしれない。
12. binおよびgenを消して、リフレッシュ(F5)してみる
13. eclipseのWorkspaceの".metadata"が壊れている。Workspaceを作り直す。ただしEclipseの環境は1から作り直しになる。

Viewing all articles
Browse latest Browse all 14

Trending Articles


Vimeo 10.7.1 by Vimeo.com, Inc.


UPDATE SC IDOL: TWO BECOME ONE


KASAMBAHAY BILL IN THE HOUSE


Girasoles para colorear


Presence Quotes – Positive Quotes


EASY COME, EASY GO


Love with Heart Breaking Quotes


Re:Mutton Pies (lleechef)


Ka longiing longsem kaba skhem bad kaba khlain ka pynlong kein ia ka...


Vimeo 10.7.0 by Vimeo.com, Inc.


FORECLOSURE OF REAL ESTATE MORTGAGE


FORTUITOUS EVENT


Pokemon para colorear


Sapos para colorear


Smile Quotes


Letting Go Quotes


Love Song lyrics that marks your Heart


RE: Mutton Pies (frankie241)


Hato lada ym dei namar ka jingpyrshah jong U JJM Nichols Roy (Bah Joy) ngin...


Long Distance Relationship Tagalog Love Quotes