저는 간단한 안드로이드 프로젝트를 가지고 있습니다. APK OK를 만들었지 만 장치에 배포 할 수는 없습니다. 현재 APK를 수동으로 복사하여 설치해야하는데 이는 상당히 성가시다.안드로이드 메이븐 플러그인, 장치에 배포 할 수 없습니다.
나는 비 Maven 프로젝트에서 사용할 USB 디버깅을 가지고, 그래서 mvn -e android:deploy -Dandroid.device=usb
내가 얻을 다음과 같은 출력을 실행하면 장치에 실제 연결은
확인을해야 :
[INFO] Finished at: Sun Mar 20 16:31:29 GMT 2011
[INFO] Final Memory: 59M/541M
[INFO] ------------------------------------------------------------------------
C:\development\projects\AndroidSam_mavenbranch>mvn -e android:deploy -Dandroid.device=usb
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Android Plugin - samples
[INFO] task-segment: [android:deploy] (aggregator-style)
[INFO] ------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2/com/admob/android/ads/20101109-ANDROID-3312276cc1406347/ads-20101109-ANDROID-3312276cc14
06347.pom
[INFO] Unable to find resource 'com.admob.android:ads:pom:20101109-ANDROID-3312276cc1406347' in repository central (http://repo1.ma
ven.org/maven2)
[INFO] [android:deploy {execution: default-cli}]
[INFO] C:\development\tools\androidSDK\android-sdk-windows/tools/adb [-d, install, -r, C:\development\projects\AndroidSam_mavenbran
ch\target\AndroidSam.apk]
[INFO] 'C:\development\tools\androidSDK\android-sdk-windows\tools\adb' is not recognized as an internal or external command,
[INFO] operable program or batch file.
[ERROR]
[ERROR] 'C:\development\tools\androidSDK\android-sdk-windows\tools\adb' is not recognized as an internal or external command,operab
le program or batch file.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error deploying C:\development\projects\AndroidSam_mavenbranch\target\AndroidSam.apk to device.
Embedded error: ANDROID-040-001: Could not execute: Command = cmd.exe /X /C "C:\development\tools\androidSDK\android-sdk-windows\to
ols\adb -d install -r C:\development\projects\AndroidSam_mavenbranch\target\AndroidSam.apk", Result = 1
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error deploying C:\development\projects\AndroidSam_mavenbranch\target\Andro
idSam.apk to device.
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error deploying C:\development\projects\AndroidSam_mavenbranch\target\An
droidSam.apk to device.
at com.jayway.maven.plugins.android.AbstractAndroidMojo.deployApk(AbstractAndroidMojo.java:425)
at com.jayway.maven.plugins.android.AbstractIntegrationtestMojo.deployBuiltApk(AbstractIntegrationtestMojo.java:101)
at com.jayway.maven.plugins.android.standalonemojos.DeployMojo.execute(DeployMojo.java:48)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 17 more
Caused by: com.jayway.maven.plugins.android.ExecutionException: ANDROID-040-001: Could not execute: Command = cmd.exe /X /C "C:\dev
elopment\tools\androidSDK\android-sdk-windows\tools\adb -d install -r C:\development\projects\AndroidSam_mavenbranch\target\Android
Sam.apk", Result = 1
at com.jayway.maven.plugins.android.CommandExecutor$Factory$1.executeCommand(CommandExecutor.java:186)
at com.jayway.maven.plugins.android.CommandExecutor$Factory$1.executeCommand(CommandExecutor.java:158)
at com.jayway.maven.plugins.android.AbstractAndroidMojo.deployApk(AbstractAndroidMojo.java:417)
... 21 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Sun Mar 20 16:31:50 GMT 2011
[INFO] Final Memory: 43M/555M
[INFO] ------------------------------------------------------------------------
이를 내 POM은 다음과 같습니다.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.jameselsey</groupId>
<artifactId>AndroidSam</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>apk</packaging>
<name>Maven Android Plugin - samples</name>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>2.2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.admob.android</groupId>
<artifactId>ads</artifactId>
<version>20101109-ANDROID-3312276cc1406347</version>
<!--<scope></scope>-->
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>maven-android-plugin</artifactId>
<version>2.6.0</version>
<configuration>
<sdk>
<!-- platform or api level (api level 4 = platform 1.6)-->
<platform>8</platform>
</sdk>
<emulator>
<!-- the name of the avd device to use for starting the emulator-->
<avd>GoogleAPIs</avd>
</emulator>
<deleteConflictingFiles>true</deleteConflictingFiles>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
<device>
</device>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<!-- version 2.3 defaults to java 1.5, so no further configuration needed-->
<version>2.3</version>
</plugin>
</plugins>
</build>
</project>
아이디어가 있으십니까?
, 플러그인, 그것은 배포를 위해 ADB를 호출하려고하지만 플러그인이 도구에서 찾고 \ 및 보인다 ADB가 다른 위치로 이동되었습니다. 내가 이것을 구성 할 수있는 곳을 찾으려고 노력 중이다. – Jimmy