Skip to main content

Featured

Build docker image from multiple build contexts

Build docker image from multiple build contexts Building a docker image requires specifying a source of truth to include in the image from a local directory or a remote git repository. In the previous version, the docker BuildKit allows users to specify the build context from a single source of truth only. However, the engineers may need to have the context from different locations based on the type of files. For instance, icons, images or other resources that are not included in the same package, including the resource from other docker images. Fortunately, the Docker Buildx toolkit supports multiple build context flag for Docker 1.4. Let's learn how to use this new feature. The following list is a shortcut for jumping into a specific topic handy. What version of Docker is this tutorial targeting? How to specify the version of Dockerfile frontend? Ho

[Eclipse]新建立的Android專案出現"R cannot be resolved to a variable"

這問題其實是很詭異的,因為同樣是今年,只是在SDK是使用r20以前的時候,都可以正常建立新專案(這時的Target SDK為2.3.3)。但今天把它更新到r22.0後,就出現了標題所列的問題。

找了很多網路資料,不管是Clean後又Build,還是專案重建,都一樣的結果。

後來找到這篇「Android: r cannot be resolved to a variable」 ,他有提到是因為SDK4.x的專案建立的時候,會在res底下多出了value-v11以及value-v14這兩個資料夾。然後這個時候設定的Minimun Required SDK是設定為2.3.3。所以根據那篇的說法,這樣2.3.3的SDK是不認識那兩個資料夾,所以就變得無法產生R.java。

後來專案刪掉後重建的時候,把Minimun Required SDK選擇成4.2,就正常可以產生R.java了。

後來又為了要確認問題,所以把Minimun Required SDK、Target SDK、以及Compile With都設定為2.3.3。嘿嘿,好玩了,建立出來的專案一樣不能產生R.java。

所以這意思是,SDK Tools用了r22以後的,就不能編譯給2.3.3用的APP嚕?

後記:
結果打完這篇之後,建出來的專案又不正常了。
之後又找了其他參考,有人指出是需要Android SDK Build-tools。所以在更新這個tools之後,r就一切都正常了。


然後如果Unity還在用3.5.7以下的話,Android SDK Platform-tools請不要更新,不然會發生Unity無法編譯apk的慘劇。唯一的解決辦法就是把,Android SDK Platform-tools降版本至16.0.2以下,以及不要安裝Android SDK Build-tools。

(2013/06/27 - 目前確認,造成Unity無法編譯的是Android SDK Build-tools,僅需把Android SDK Build-tools移除掉,Unity就可以正常編譯了。)

Comments

Post a Comment

Popular Posts