GCM(5)Working with MAVEN and Android OS Upgrade 2.3.7

The latest GCM API is working fine with Android Studio and gradle. I love it. But I still need to figure out how to working and build with my old maven.

First of all, I met this Error Message
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.4.0:generate-sources (default-generate-sources) on project Localpoint_Android_SDK: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.4.0:generate-sources failed: Could not find tool 'aapt'. Please provide a proper Android SDK directory path as configuration parameter <sdk><path>...</path></sdk> in the plugin <configuration/>. As an alternative, you may add the parameter to commandline: -Dandroid.sdk.path=... or set environment variable ANDROID_HOME. -> [Help 1]

Solution:
>sudo ln -s /opt/android-sdk/build-tools/19.0.1/aapt /opt/android-sdk/platform-tools/aapt
>sudo ln -s /opt/android-sdk/build-tools/19.0.1/lib /opt/android-sdk/platform-tools/lib
>sudo ln -s /opt/android-sdk/build-tools/19.0.1/aidl /opt/android-sdk/platform-tools/aidl

Then I can use command as follow:
>mvn clean assembly:single

Enable Google Play Service
Get the Maven Android SDK Deployer from herehttps://github.com/mosabua/maven-android-sdk-deployer
>mvn clean install

And configure the android.repo and URL in pom.xml and settings.xml
>mvn deploy

One more thing, this command should be execute under maven 3.1.1 or above.

Add the Google Play Service in pom.xml as follow
<dependency>
<groupId>com.google.android.gms</groupId>
<artifactId>google-play-services</artifactId>
<version>13.0.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>android.support</groupId>
<artifactId>compatibility-v4</artifactId>
<version>19.0.0</version>
</dependency>

Error Message:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;

Solution:
Delete the android-support-v4.jar under lib directory.

Error Message:
Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4030500 but found 0. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

Solution:
/opt/android-sdk/extras/google/google_play_services/libproject/google-play-services_lib/res/values
Check the value from this file version.xml

I add this in the AndroidManifest.xml file as follow:
<meta-data
android:name="com.google.android.gms.version"
android:value="4030500" />

But at last I found even I delete these lines, the error message did not show up anymore.

2. Building environment
Gradle eclipse plugin
http://www.gradle.org/docs/current/userguide/eclipse_plugin.html

Since I am using STS, I can easily install the gradle plugin there.

3. Upgrade my old Android OS from 2.2 to 2.3.7
Go and install the HTC Sync Manager
http://www.htc.com/www/software/htc-sync-manager/
Change the connection type of HTC to HTC Sync

Go and find this fine from HTCAndroid 2.3 (Gingerbread) Upgrade for HTC Desire

But my phone is old HTC G7 desire abrova, it can not find the HTC Sync. So I give other this way, and I will try other method.

Install the OS from ROM
First of all, install the get root software on my MAC system, the tool is getting from herehttp://www.unrevoked.com/#desire

Then use command line to disable app2sd
>adb shell
>pm setInstallLocation 0
>reboot

Then, turn off the android device, hold the button ’start’, ‘low volumn’ to start my phone into recover mode.

Choose ‘RECOVERY’ (Use Home button or Power button to select)

Download the right update.zip, and use ADB command to upload it to sdcard
>adb push /Users/carl/data/update.zip /sdcard/update.zip

Choose ‘install zip from sdcard’ (Use Home button or Power button to select)

But sometimes, I got these errors.
Error Message:
assert failed: file_getprop(“/system/build.prop”.”ro.build.fingerprint”) == “google/passion/passion:2.3.4/GRJ22/121341:user/release-keys” || file_getprop(“/system/build.prop”.”ro.build.fingerprint”) == “google/passion/passion:2.3.5/GRK39F/189904:user/release-keys”
E:Error in /sdcard/update.zip
(Status 7)
Installation aborted.

Solution:
This is my configuration file from the /system/build.prop
ro.build.fingerprint=hkcsl_cht/htc_bravo/bravo/bravo:2.2/FRF91/274424:user/release-keys
ro.product.device=bravo

So that means my device is HTC Desire bravo, I get the wrong update.zip file. So I come to this website
http://download.cyanogenmod.org/?device=bravo

I find the versionhttp://mirror.slc.cyanogenmod.org/jenkins/3075/cm-7.2.0.1-bravo.zip

I rename it to update.zip and upload there, try again. Everything went well this time. Just reboot the system to enjoy the new OS.



References:
http://sillycat.iteye.com/blog/1998911

Tips
https://github.com/donnfelker/android-bootstrap/issues/46
http://reviews.cnet.co.uk/mobile-phones/how-to-update-htc-desire-to-android-2-3-gingerbread-50004625/
http://android.958shop.com/detail/35405.html
http://gfans.bryan.tw/2010/09/22/801
http://true-android.blogspot.com/2013/11/update-htc-desire-to-android-237.html

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. android多媒体篇-音频-1 音频相关基础知
  2. android 软键盘Enter键图标的设置 androi
  3. STM32循迹小车/Android蓝牙控制小车(四)完
  4. Android(安卓)TTS 中文 文字转语音 使用T
  5. Android(安卓)必知必会-Android(安卓)Spl
  6. Android项目开发时版本选择
  7. 使用vs2010查看android原生代码
  8. Android信息推送技术简要分析
  9. android8.0/android O 新特性
  10. MAC查看某一so文件的cpu匹配