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

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 here https://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 HTC Android 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 here http://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 version http://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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值