R.txt isn't a file error when building aar

350 views
Skip to first unread message

Mustafa Sezgin

unread,
Feb 13, 2014, 6:10:58 AM2/13/14
to maven-androi...@googlegroups.com
Hey all,

Im currently having an issue on the 3.8.2 version of the plugin. Im trying to build an aar library with shared libraries that have been built with the ndk. The build fails with the following error

[INFO] --- android-maven-plugin:3.8.2:aar (default-aar) @ skippy ---
[INFO] /usr/local/opt/androidsdk/build-tools/19.0.1/aapt [package, -f, -M, /Users/mustafa/Workspace/stuff/skippy/android/AndroidManifest.xml, -S, /Users/mustafa/Workspace/stuff/skippy/android/res, --auto-add-overlay, -I, /usr/local/opt/androidsdk/platforms/android-19/android.jar, -F, /Users/mustafa/Workspace/stuff/skippy/android/target/skippy-0.0.1-SNAPSHOT.ap_, -m, -J, /Users/mustafa/Workspace/stuff/skippy/android/target/generated-sources/r, --non-constant-id, --output-text-symbols, /Users/mustafa/Workspace/stuff/skippy/android/target]
[INFO] Building jar: /Users/mustafa/Workspace/stuff/skippy/android/target/skippy-0.0.1-SNAPSHOT.aar.classes.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.920s
[INFO] Finished at: Thu Feb 13 13:01:32 EET 2014
[INFO] Final Memory: 16M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:aar (default-aar) on project skippy: ArchiverException while creating .aar file. /Users/mustafa/Workspace/stuff/skippy/android/target/R.txt isn't a file. -> [Help 1]

Stacktrace is

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:aar (default-aar) on project skippy: ArchiverException while creating .aar file.
 at org
.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
 at org
.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
 at org
.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
 at org
.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
 at org
.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
 at org
.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
 at org
.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
 at org
.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
 at org
.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
 at org
.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
 at org
.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
 at org
.apache.maven.cli.MavenCli.main(MavenCli.java:158)
 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.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
 at org
.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
 at org
.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
 at org
.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: ArchiverException while creating .aar file.
 at com
.jayway.maven.plugins.android.phase09package.AarMojo.createApkLibraryFile(AarMojo.java:221)
 at com
.jayway.maven.plugins.android.phase09package.AarMojo.execute(AarMojo.java:137)
 at org
.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
 at org
.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
 
... 19 more
Caused by: org.codehaus.plexus.archiver.ArchiverException: /Users/mustafa/Workspace/stuff/skippy/android/target/R.txt isn't a file.
 at org.codehaus.plexus.archiver.AbstractArchiver.addFile(AbstractArchiver.java:386)
 at org.codehaus.plexus.archiver.AbstractArchiver.addFile(AbstractArchiver.java:326)
 at com.jayway.maven.plugins.android.phase09package.AarMojo.addR(AarMojo.java:234)
 at com.jayway.maven.plugins.android.phase09package.AarMojo.createApkLibraryFile(AarMojo.java:212)
 ... 22 more





Maven version is 3.1.1. Even if I make the pom very simple as follows

<plugin>
               
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
               
<artifactId>android-maven-plugin</artifactId>
               
<version>3.8.2</version>
               
<configuration>
                   
<sdk>
                       
<platform>${androidApiLevel}</platform>
                   
</sdk>
               
</configuration>
               
<extensions>true</extensions>
           
</plugin>

It still produces the same error. Been trying a lot of things but cannot get past this. Any help would be appreciated.


Manfred Moser

unread,
Feb 14, 2014, 2:38:25 AM2/14/14
to maven-androi...@googlegroups.com

Try the 3.8.3-SNAPSHOT version..  3.8.,2 is very different and has various problems that we are addressing currently. 

--
You received this message because you are subscribed to the Google Groups "Maven Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maven-android-deve...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages