Showing posts with label Eclipse. Show all posts
Showing posts with label Eclipse. Show all posts

Tuesday, December 31, 2013

串接Admob時岀現The Google Play services resources were not found.

文章攢寫時間︰2013/12/31 17:45
Admob使用版本︰Goole Play Service 4.0版

一、問題

今天在串接Admob時,
遇到
The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
的錯誤,
Admob廣告一直沒有岀現。

二、解決辦法

請在values\strings.xml裡,
填上你的ad_unit_id...


Sunday, May 27, 2012

設定Eclipse編輯區的字體大小


Wednesday, December 28, 2011

Eclipse註解在Mac上變亂碼

有時候在Windows上的Eclipse開發完的案子,
註解在Mac上開起來卻變成亂碼,
主要原因是因為Windows的Eclipse預設文字編碼是Windwos系統編碼,
Mac不認識這種編碼造成的。

解決辦法就是將Windows上的編碼設成UTF-8,
這樣的話在Mac上就沒有問題了。

步驟
[現在你在windows的Eclipse環境底下]
1.先將一份Source Code複製至桌面
2.對著你的專案點擊滑鼠
2.選擇最下面的properties
3.出現以下的視窗後,將編碼設為UTF-8
4.此時會發現你原本的專案文字都變成亂碼,將桌面上的java頁面一頁一頁複製過來。
5.如此,Mac的開發員才會看到UTF-8編碼的Source Code。

簡言之,新的編碼格式是發生在Step3設定完後開始做編寫,才算術。

Wednesday, November 16, 2011

重整你的函式(Method)排序

經過一段辛苦的開發後,
Method其實都被我們寫蠻亂的。
這時候就可以利用Eclipse的Sort Members功能排序Method。

我們針對需要排序的class點擊滑鼠右鍵

然後,就會發現函式被排序了。

這樣子找函式,
是不是更有效率了呢?

Friday, October 14, 2011

一個Eclipse匯入Android變紅XX的錯誤

案子在匯入後會變成紅色方型XX,
有非常多的理由。
通常我們都要在第1時間去看Console視窗裡寫些什麼錯誤訊息。


今天在匯入案子進筆電時,
發生了一個錯誤︰

[2011-10-15 14:25:00 - JeremyLiu] Dx
trouble processing "java/nio/CharBuffer.class":

Ill-advised or mistaken usage of a core class (java.* or javax.*)
when not building a core library.

This is often due to inadvertently including a core library file
in your application's project, when using an IDE (such as
Eclipse). If you are sure you're not intentionally defining a
core class, then this is the most likely explanation of what's
going on.

However, you might actually be trying to define a class in a core
namespace, the source of which you may have taken, for example,
from a non-Android virtual machine project. This will most
assuredly not work. At a minimum, it jeopardizes the
compatibility of your app with future versions of the platform.
It is also often of questionable legality.

If you really intend to build a core library -- which is only
appropriate as part of creating a full virtual machine
distribution, as opposed to compiling an application -- then use
the "--core-library" option to suppress this error message.

If you go ahead and use "--core-library" but are in fact
building an application, then be forewarned that your application
will still fail to build or run, at some point. Please be
prepared for angry customers who find, for example, that your
application ceases to function once they upgrade their operating
system. You will be to blame for this problem.

If you are legitimately using some code that happens to be in a
core package, then the easiest safe alternative you have is to
repackage that code. That is, move the classes in question into
your own package namespace. This means that they will never be in
conflict with core system classes. JarJar is a tool that may help
you in this endeavor. If you find that you cannot do this, then
that is an indication that the path you are on will ultimately
lead to pain, suffering, grief, and lamentation.

[2011-10-15 14:25:00 - JeremyLiu] Dx 1 error; aborting
[2011-10-15 14:25:00 - JeremyLiu] Conversion to Dalvik format failed with error 1

後來查了一下國外的論壇,才發現是專案在匯入Android的Jar檔時,Library Build錯位置了。

整個關鍵在於︰

 解決方式︰
Library標籤下應該會有一個android.jar(沒有放在Android2.2目錄下) ,
將其刪除,
並再將Android2.2Library匯入即可。