2013年10月30日 星期三

Couldn't register xxx.xxx with the bootstrap server. Error: unknown error code.

今天用iphone實機來debug, 

 後來發現程式居然一直傳不上去手機 

 明明就沒動到什麼 而出現以下error

Couldn't register 我的package名稱 with the bootstrap server. Error: unknown error code.
This generally means that another instance of this process was already running or is hung in the debugger.

後來查了查 原來只要將 你的iPhone重新開機就可以了

2013年10月23日 星期三

GoogleMaps.framework/GoogleMaps for architecture armv7s 錯誤


今天在發佈Google Maps API for iOS version 1.4.3版本時

發現在模擬器上跑可以正常發佈,

但要裝到實機一直出現以下error

ld: file is universal (2 slices) but does not contain a(n) armv7s slice: mypath.../  GoogleMaps.framework/GoogleMaps for architecture armv7s

卡了很久 最後終於查到是armv7s架構出的問題,

因為我是發佈到ios5.1版本,

需把armv7s刪除。

到 Project -> Build Settings -> Valid Architectures 裡 把armv7s刪除,

就可以正常發佈到iOS5.1的手機上囉~

2013年10月22日 星期二

ios 5 Could not instantiate class named NSLayoutConstraint問題

在 iOS 5 不支援 AutoLayout的功能,

若在storyboard或xib上建立 預設通常會把AutoLayout打勾,

但你用iOS5來發佈就會出現

Could not instantiate class named NSLayoutConstraint

的錯誤訊息。

只要將AutoLayout打勾取消即可解決此問題

2013年10月21日 星期一

ios google map api 出現 NSInvalidArgumentException', reason: '+[GMSCameraPosition .. error

今天在開發使用Google Maps API for iOS

出現以下error 2013-10-22 10:13:52.736 HM[1155:12e03] +[GMSCameraPosition cameraWithLatitude:longitude:zoom(inlove): unrecognized selector sent to class 0x3305b0 2013-10-22 10:13:52.737 HM[1155:12e03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[GMSCameraPosition cameraWithLatitude:longitude:zoom(inlove): unrecognized selector sent to class 0x3305b0' *** First throw call stack: (0x273f012 0x2564e7e 0x27ca2ad 0x272ebbc 0x272e94e 0x6cf6f 0x158a1c7 0x158a232 0x158a4da 0x15a18e5 0x15a19cb 0x15a1c76 0x15a1d71 0x15a289b 0x15a2e93 0x15a2a88 0x18fee63 0x18f0b99 0x18f0c14 0x2578705 0x14ac2c0 0x14ac258 0x156d021 0x156d57f 0x156c6e8 0x14dbcef 0x14dbf02 0x14b9d4a 0x14ab698 0x3216df9 0x3216ad0 0x26b4bf5 0x26b4962 0x26e5bb6 0x26e4f44 0x26e4e1b 0x32157e3 0x3215668 0x14a8ffc 0x2dbd 0x2ce5) libc++abi.dylib: terminate called throwing an exception

主要解決方案是 到
Project → Build Settings → 搜尋 Other Linker Flag → Other Linker Flags -> 加入 -ObjC

這樣就可以解決此問題。

不過 接下來又出現一個問題,

就是

GMSServicesException', reason: 'GoogleMaps.bundle requires Google Maps SDK for iOS to be part of your target under 'Copy Bundle Resources''

的error

此error只要將你Frameworks裡的
GoogleMaps.framework 右鍵→show in finder -> Resources → GoogleMaps.bundle拉到

Frameworks的資料夾 我是沒有將copy items into destination groups folder 打勾,

因為GoogleMaps.framework已經copy items在project裡頭了~

2013年10月15日 星期二

Android GCM問題 -- GCMIntentService (has extras) }: not found

這個問題卡了我好久多天

Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTRATION flg=0x10 pkg=   cmp=xxx.xxx.xxx  /.GCMIntentService (has extras) }: not found


通常GCMIntentService都會存在根目錄(root)之下,
所以android的gcm去抓GCMIntentService是去抓root的file,


但如果的project有許多package name的話,


你必須要去修改 GCMBroadcastReceiver 回傳GCMIntentService的class package name,



所以要自訂一個GCMReceiver去繼承GCMBroadcastReceiver,

並Override 掉 getGCMIntentServiceClassName 回傳你的GCMIntentService的package name,



再去修改AndroidMainfest.xml 的receiver android:name 與service android name



您可以參考 這篇:

http://stackoverflow.com/questions/12089428/gcm-with-custom-broadcastreceiver



http://dexxtr.com/post/28188228252/rename-or-change-package-of-gcmintentservice-class

2013年10月2日 星期三

google-play-services_lib/bin(missing) 錯誤問題

原本要來試 Google Play Services的功能,

但第一步居然就讓我卡關卡了幾天= =

使用Google play services 需要先到AVD安裝Google Play Services 的SDK,

然後再到eclipse內 import->android->existing android code into workspace

匯入google play services的專案,

專案路徑是在你Android SDK的資料夾/extras/google/google_play_services

把此專案import後,

重點是在你自己的專案按右鍵->Properties ->Android->Add->會看見google-play-services-lib的專案,點選他,

若您沒有看見就是前面的步驟有誤。

記得is Library不需要打勾,

照理說這樣就可以很容易的使用到Google play services的lib了,

可是在發佈時會出現

google-play-services_lib/bin(missing) 錯誤問題

最後我的解決方案是

按下我的專案右鍵->java compiler->enable project is specific打勾

把compiler compilance level: 1.6先改1.7 按下確定後

再按專案右鍵  android tools->fix project properties

然後發佈看是否能成功編譯

成功的話再將1.7再改回1.6 重新再做一次fix project properties

然後也把專案project->clean

這樣就正常了= =

感覺是eclipse的問題..

以上是我個人試成功的經驗,不一定是最正確的方式~提供參考

=============2013.10.07===============
今天又遇到此問題

以上方式還是出現一樣error

後來嘗試把jar檔通通移除重新加次一次就可以囉~





2013年10月1日 星期二

更新ADT後發出 Multiple dex..錯誤解決方案

昨日更新了ADT,

把之前的專案發佈一直出現以下error,

花了一個小時才解決..


Dex Loader] Unable to execute dex: Multiple dex files define Lorg/kobjects/isodate/IsoDate

我的解決方式是將jar檔刪除,重新加入一次,

然後記得不要加到沒有用到的jar檔,

我把android-support-v4.jar拿掉,

重新發佈問題就解決了~