android apklib,Android apklib: Doublicate R.java

I have an Android project with a dependency to a apklib project. In the apklib project a R.java file will be generated and packed into the result apklib file. The Android project unzip it via android plugin and rebuild all code. In consequence of this there are a doublicate R file compilation error cause the plugin try to rebuild the R file of the apklib project resources in the Android project.

What is the problem? Here my snippets from the pom files:

<?xml version="1.0"?>

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

...apk

com.jayway.maven.plugins.android.generation2

android-maven-plugin

3.8.0

true

${project.basedir}/AndroidManifest.xml

${project.basedir}/assets

${project.basedir}/res

${project.basedir}/gen

15

${android.sdk.path}

false

MyAndroid

usb

true

true

...

com.google.android

android

4.0.1.2

provided

com.google.android

android-test

4.0.1.2

test

com.google.android

support-v4

r12

...

my.group.id

artifact

1.0.0-SNAPSHOT

apklib

<?xml version="1.0"?>

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">apklib

com.jayway.maven.plugins.android.generation2

android-maven-plugin

3.8.0

true

${project.basedir}/AndroidManifest.xml

${project.basedir}/assets

${project.basedir}/res

${project.basedir}/gen

15

${android.sdk.path}

...

com.google.android

android

4.0.1.2

provided

com.google.android

android-test

4.0.1.2

test

com.google.android

support-v4

r12

...

The problem is that the in the apklib generated R.java file is copied into the gen folder of the Android project by the aapt tool (V. 19). I work with Windows platform, maven 3.1.1 and the android maven plugin 3.8.0 on both projects.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值