设为首页 收藏本站
查看: 981|回复: 0

[经验分享] GCM(5)Working with MAVEN and Android OS Upgrade 2.3.7

[复制链接]

尚未签到

发表于 2016-5-18 11:19:54 | 显示全部楼层 |阅读模式
  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.iyunv.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、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-218668-1-1.html 上篇帖子: Android获取本机IP地址(不是localhost)和MAC的方法 下篇帖子: 使用jQuery插件jScrollPane开发Mac OSX Lion风格的滚动条
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表