开发者

Android - maven - build error

开发者 https://www.devze.com 2023-04-02 11:29 出处:网络
maven-plugin , the build is success , but the when i try mvn clean install i got this logs [INFO] Reloading plugin container for: org.apache.maven.plugins:maven-clean-plugin. The plugin artifact has

maven-plugin , the build is success , but the when i try mvn clean install i got this logs

[INFO] Reloading plugin container for: org.apache.maven.plugins:maven-clean-plugin. The plugin artifact has changed.

[INFO] [clean:clean] [INFO] Deleting file-set: distrib (included: [.], excluded: []) [INFO] Reloading plugin container for: org.apache.maven.plugins:maven-antrun-plugin. The plugin artifact has changed. [INFO] Reloading plugin container for: org.apache.maven.plugins:maven-changes-plugin. The plugin artifact has changed. [INFO] Reloading plugin container for: org.apache.maven.plugins:maven-eclipse-plugin. The plugin artifact has changed. [INFO] Reloading plugin container for: com.atlassian.maven.plugins:maven-clover2-plugin. The plugin artifact has changed. [INFO] Reloading plugin container for: org.apache.maven.plugins:maven-surefire-plugin. The plugin artifact has changed. [INFO] Reloading plugin container for: org.apache.maven.plugins:maven-compiler-plugin. The plugin artifact has changed. [INFO] Reloading plugin container for: org.apache.maven.plugins:maven-ejb-plugin. The plugin artifact has changed. [INFO] Reloading plugin container for: org.apache.maven.plugins:maven-jar-plugin. The plugin artifact has changed. [INFO] Reloading plugin container for: org.apache.maven.plugins:maven-war-plugin. The plugin artifact has changed. [INFO] Reloading plugin container for: org.apache.maven.plugins:maven-pmd-plugin. The plugin artifact has changed. [INFO] Reloading plugin container for: org.apache.maven.plugins:maven-assembly-plugin. The plugin artifact has changed. [INFO] Reloading plugin container for: org.apache.maven.plugins:maven-clean-plugin. The plugin artifact has changed. [INFO] Reloading plugin container for: org.apache.maven.plugins:maven-release-plugin. The plugin artifact has changed. [INFO] Reloading plugin container for: org.apache.maven.plugins:maven-javadoc-plugin. The plugin artifact has changed. [INFO] Reloading plugin container for: org.apache.maven.plugins:maven-site-plugin. The plugin artifact has changed. [INFO] Reloading plugin container for: org.apache.maven.plugins:maven-install-plugin. The plugin artifact has changed. [INFO] [site:attach-descriptor] [INFO] [install:install] [INFO] Installing D:\RSM\mobile\fd-mobile-android\pom.xml to C:\Users\hkhwileh.m2\repository\com\firstderivatives\rsm\mobile\android\fd-mobile-androi d-parent\5.4-SNAPSHOT\fd-mobile-android-parent-5.4-SNAPSHOT.pom [INFO] ------------------------------------------------------------------------

[ERROR] Cannot create the APKBuilder object

com.android.sdklib.build.ApkCreationException: java.io.FileNotFoundException: D:\RSM\mobile\fd-mobile-android\application\target\classes.dex does not exist at com.android.sdklib.build.ApkBuilder.init(ApkBuilder.java:455) at com.android.sdklib.build.ApkBuilder.(ApkBuilder.java:386) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.jayway.maven.plugins.android.phase09package.ApkBuilder.(ApkBuilder.java:197) at com.jayway.maven.plugins.android.phase09package.ApkMojo.doAPKWithAPKBuilder(ApkMojo.java:206) at com.jayway.maven.plugins.android.phase09package.ApkMojo.createApkFile(ApkMojo.java:171) at com.jayway.maven.plugins.android.phase09package.ApkMojo.execute(ApkMojo.java:144) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451) at org.apache.maven.lifecy开发者_Python百科cle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129) at org.apache.maven.cli.MavenCli.main(MavenCli.java:287) 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: java.io.FileNotFoundException: D:\RSM\mobile\fd-mobile-android\application\target\classes.dex does not exist at com.android.sdklib.build.ApkBuilder.checkInputFile(ApkBuilder.java:828) at com.android.sdklib.build.ApkBuilder.init(ApkBuilder.java:432) ... 27 more

and the tail so any one can help me


I' guessing you are using maven-android-plugin to build your application. The problem is that you have to pack your classes to dex file before invoking android:apk goal. To convert classes to dex format you need to use android:dex goal you also need to generate some other files.

The whole command I use to build Android applications is: mvn clean compile android:generate-sources android:dex android:apk


Provide more details about your project and maybe file a bug. Also try it with the latest 3.0.0-alpha release..

Update: at this stage the latest release is 3.5.0 and generally if you keep your Android SDK up to date (and you should), you should also follow the release of the Android Maven Plugin.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号