`
sillycat
  • 浏览: 2486037 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

How to Build APK and Install APK

 
阅读更多

How to Build APK and Install APK

First thing, I upgrade my maven to the latest version, so I have problem to build the apk file.

Error Message:
[INFO] --- android-maven-plugin:3.6.0:generate-sources (default-generate-sources) @ google-play-services --- [WARNING] Error injecting: com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo java.lang.NoClassDefFoundError: Lorg/sonatype/aether/RepositorySystem;        at java.lang.Class.getDeclaredFields0(Native Method)        at java.lang.Class.privateGetDeclaredFields(Class.java:2387)        at java.lang.Class.getDeclaredFields(Class.java:1796)        at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:661)        at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:366)        at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:165)        at com.google.inject.internal.InjectorImpl.getInternalDependencies(InjectorImpl.java:609)        at com.google.inject.internal.InjectorImpl.cleanup(InjectorImpl.java:565)
        at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:551)

Solution:
The solution is that the latest version does not mean the best version. So I roll back my maven to 3.0.5 version. It works.

The I try the eclipse related tool to generate the apk file like this.
[Android Tool] —> [Export Signed Android Application]

But when I try to install the APK, I use command.
adb install -r ./LocalpointTester_Android.apk
adb install ./LocalpointTester_Android.apk

If I run the command without -r option, I got Error Message:
Failure [INSTALL_FAILED_ALREADY_EXISTS]

If I run the command with -r option, I got Error Message:
Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]

Because the signature is different from different developers. So I uninstall the app from the device- application manager.

It works fine then.

And the APK file is automatically generated under [Project Name] —> [bin] directory.

Or we can generate from Menu [ Build ] ——> [Generate Signed APK]

References:
http://stackoverflow.com/questions/17293940/soap-enabler-maven-build-failure
http://maven.apache.org/download.cgi

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics