kingdom578 / maven-android-plugin

Automatically exported from code.google.com/p/maven-android-plugin
0 stars 0 forks source link

COMPILATION ERROR #463

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an APKLIB project
2. Create APK project with dependency of this APKLIB
3. Run "mvn clean install"

What is the expected output?
[ERROR] 
/D:/worksp/mcap/appstore/target/unpacked-libs/ct_om-moduel/src/com/tcd/om/MainAc
tivity.java:[45,31] D:\worksp\mcap\appstore\target\unpacked-li
bs\ct_om-moduel\src\com\tcd\om\MainActivity.java:45: 找不到符号
符号: 变量 bt_active
位置: 类 com.tcd.om.R.id
[ERROR] 
/D:/worksp/mcap/appstore/target/unpacked-libs/ct_om-moduel/src/com/tcd/om/MainAc
tivity.java:[47,37] D:\worksp\mcap\appstore\target\unpacked-li
bs\ct_om-moduel\src\com\tcd\om\MainActivity.java:47: 找不到符号
符号: 变量 d2d_bt
位置: 类 com.tcd.om.R.id
[ERROR] 
/D:/worksp/mcap/appstore/target/unpacked-libs/ct_om-moduel/src/com/tcd/om/MainAc
tivity.java:[50,37] D:\worksp\mcap\appstore\target\unpacked-li
bs\ct_om-moduel\src\com\tcd\om\MainActivity.java:50: 找不到符号
符号: 变量 channel_bt
位置: 类 com.tcd.om.R.id
[ERROR] 
/D:/worksp/mcap/appstore/target/unpacked-libs/ct_om-moduel/src/com/tcd/om/MainAc
tivity.java:[53,37] D:\worksp\mcap\appstore\target\unpacked-li
bs\ct_om-moduel\src\com\tcd\om\MainActivity.java:53: 找不到符号

What do you see instead?
[INFO] 26 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 35.592 s
[INFO] Finished at: 2014-05-06T11:19:37+08:00
[INFO] Final Memory: 21M/140M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on 
project appstore: Compilation failure:
Compilation failure:
[ERROR] 
/D:/worksp/mcap/appstore/target/unpacked-libs/ct_om-moduel/src/com/tcd/om/MainAc
tivity.java:[45,31] D:\worksp\mcap\appstore\target\unpacked-li
bs\ct_om-moduel\src\com\tcd\om\MainActivity.java:45: 找不到符号
[ERROR] 符号: 变量 bt_active
[ERROR] 位置: 类 com.tcd.om.R.id
[ERROR] 
/D:/worksp/mcap/appstore/target/unpacked-libs/ct_om-moduel/src/com/tcd/om/MainAc
tivity.java:[47,37] D:\worksp\mcap\appstore\target\unpacked-li
bs\ct_om-moduel\src\com\tcd\om\MainActivity.java:47: 找不到符号
[ERROR] 符号: 变量 d2d_bt
[ERROR] 位置: 类 com.tcd.om.R.id
[ERROR] 
/D:/worksp/mcap/appstore/target/unpacked-libs/ct_om-moduel/src/com/tcd/om/MainAc
tivity.java:[50,37] D:\worksp\mcap\appstore\target\unpacked-li
bs\ct_om-moduel\src\com\tcd\om\MainActivity.java:50: 找不到符号
[ERROR] 符号: 变量 channel_bt
[ERROR] 位置: 类 com.tcd.om.R.id
[ERROR] 符号: 变量 smsc
[ERROR] 位置: 类 com.tcd.moduels.pdu.R.id
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-com
pile) on project appstore: Compilation failure
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
        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:108)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
        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.compiler.CompilationFailureException: 
Compilation failure
        at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:858)
        at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 19 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please 
read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

What version of maven-android-plugin are you using?
3.9.0-rc.1

What are the complete output lines of "mvn -version" on your machine?
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 
2014-02-15T01:37:52+08:00)
Maven home: D:\Program Files\apache-maven-3.2.1\bin\..
Java version: 1.6.0_71, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_71\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

Please provide any additional information below.
With the same projects , use the 3.8.2 version of maven-android-plugin is no 
problem
,and the apklib projects build success,but apk project build failue.

Original issue reported on code.google.com by david.zh...@gmail.com on 6 May 2014 at 3:34

GoogleCodeExporter commented 9 years ago
Can you provide a cut down project or projects that show the error.

Original comment by william....@xandar.com.au on 8 May 2014 at 11:09

GoogleCodeExporter commented 9 years ago
I found it,in my apklib project,if the view id defind the same name with the 
layout name,the bug will be found.

Original comment by david.zh...@gmail.com on 9 May 2014 at 1:55

Attachments:

GoogleCodeExporter commented 9 years ago
So this is a non-issue then?

Original comment by william....@xandar.com.au on 9 May 2014 at 3:08

GoogleCodeExporter commented 9 years ago
  I don't think so,view id and layout can be defined with the same name.In android project and version of maven-android-plugin 3.8.2 it is no problem.
  If 3.9.0-rc.1 defined with the same name,R.txt only layout can be found the id.
  see simple.zip

int dimen activity_horizontal_margin 0x7f040000
int dimen activity_vertical_margin 0x7f040001
int drawable ic_launcher 0x7f020000
int id action_settings 0x7f080003
int id test_apklib 0x7f080001
int id test_native 0x7f080002
int id textView1 0x7f080000
int layout activity_main 0x7f030000
int menu main 0x7f070000
int string action_settings 0x7f050002
int string app_name 0x7f050000
int string hello 0x7f050004
int string hello_apklib 0x7f050001
int string hello_world 0x7f050003
int style AppBaseTheme 0x7f060000
int style AppTheme 0x7f060001

Original comment by david.zh...@gmail.com on 9 May 2014 at 6:06

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
  Sorry, my English is so-so, I am not well understood non-issue, It means my issue is not an issue or is an issue, Just this issue is not resolved.

Original comment by david.zh...@gmail.com on 9 May 2014 at 6:21

GoogleCodeExporter commented 9 years ago
Non-issue means that it is not an issue. But if you believe it still is
then I will take a look over the weekend.

Original comment by william....@xandar.com.au on 9 May 2014 at 6:26

GoogleCodeExporter commented 9 years ago
Yes,I believe It is an issue,and I test it again,not only the same name can be 
compile error,but all apklib defined view id will be not found at the apk 
project.

You can find it at this dir :target\generated-sources\r

The strange thing is that R.txt exist these ids.

Original comment by david.zh...@gmail.com on 9 May 2014 at 9:05

Attachments:

GoogleCodeExporter commented 9 years ago
David, I believe I have a fix which I have submitted as a pull request.

In the meantime, you can checkout and build 
https://github.com/william-ferguson-au/maven-android-plugin/tree/issue-463. Let 
me know how you go.

Original comment by william....@xandar.com.au on 11 May 2014 at 7:57

GoogleCodeExporter commented 9 years ago
Hi
 I had checkout issue-463,and build the simple project,it still have the problem.

Error Info:

D:\worksp\simple>mvn clean install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for 
com.david:android-test-apk:apk:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for 
org.apache.maven.plugins:maven-jarsigner-plugin is missing. @ line 46, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for 
com.david:android-test-apklib:apklib:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for 
org.apache.maven.plugins:maven-jarsigner-plugin is missing. @ line 40, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten 
the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support 
building such malformed projects.
[WARNING]
Downloading: 
http://om.taichenda.com:8081/nexus/content/groups/public/com/david/android-test-
apklib/0.0.1-SNAPSHOT/maven-metadata.xml
Downloading: 
http://om.taichenda.com:8081/nexus/content/groups/public/com/david/android-test-
apklib2/0.0.1-SNAPSHOT/maven-metadata.xml
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] simple
[INFO] android-test-apklib
[INFO] android-test-apklib2
[INFO] android-test-apk
[INFO]
[INFO] Using the builder 
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder
 with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building simple 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ simple ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ simple ---
[INFO] Installing D:\worksp\simple\pom.xml to D:\Program 
Files\apache-maven-3.2.1\repository\com\david\simple\0.0.1-SNAPSHOT\simple-0.0.1
-SNAPSHOT.pom

[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building android-test-apklib 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: 
http://om.taichenda.com:8081/nexus/content/groups/public/org/apache/maven/plugin
s/maven-jarsigner-plugin/maven-metadata.xml
Downloaded: 
http://om.taichenda.com:8081/nexus/content/groups/public/org/apache/maven/plugin
s/maven-jarsigner-plugin/maven-metadata.xml (500 B at 0.8
KB/sec)
Downloading: 
http://om.taichenda.com:8081/nexus/content/groups/public/org/apache/maven/plugin
s/maven-resources-plugin/maven-metadata.xml
Downloaded: 
http://om.taichenda.com:8081/nexus/content/groups/public/org/apache/maven/plugin
s/maven-resources-plugin/maven-metadata.xml (686 B at 1.6
KB/sec)
Downloading: 
http://om.taichenda.com:8081/nexus/content/groups/public/org/apache/maven/plugin
s/maven-surefire-plugin/maven-metadata.xml
Downloaded: 
http://om.taichenda.com:8081/nexus/content/groups/public/org/apache/maven/plugin
s/maven-surefire-plugin/maven-metadata.xml (2 KB at 1.2 KB
/sec)
Downloading: 
http://om.taichenda.com:8081/nexus/content/groups/public/org/apache/maven/plugin
s/maven-compiler-plugin/maven-metadata.xml
Downloaded: 
http://om.taichenda.com:8081/nexus/content/groups/public/org/apache/maven/plugin
s/maven-compiler-plugin/maven-metadata.xml (740 B at 1.8 K
B/sec)
Downloading: 
http://om.taichenda.com:8081/nexus/content/groups/public/org/apache/maven/plugin
s/maven-jar-plugin/maven-metadata.xml
Downloaded: 
http://om.taichenda.com:8081/nexus/content/groups/public/org/apache/maven/plugin
s/maven-jar-plugin/maven-metadata.xml (588 B at 0.6 KB/sec
)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ android-test-apklib 
---
[INFO] Deleting D:\worksp\simple\android-test-apklib\target
[INFO]
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:generate-sources 
(default-generate-sources) @ android-test-apklib ---
[INFO] Manifest copying disabled. Using default manifest only
[INFO] Extracting libs
[INFO] Manifest merging disabled. Using project manifest only
[INFO] Generating R file for com.david:android-test-apklib:apklib:0.0.1-SNAPSHOT
[INFO] Adding R gen folder to compile classpath: 
D:\worksp\simple\android-test-apklib\target\generated-sources\r
[INFO] Adding AIDL gen folder to compile classpath: 
D:\worksp\simple\android-test-apklib\target\generated-sources\aidl
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 
android-test-apklib ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
D:\worksp\simple\android-test-apklib\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ 
android-test-apklib ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to 
D:\worksp\simple\android-test-apklib\target\classes
[INFO]
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:proguard (default-proguard) @ 
android-test-apklib ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ 
android-test-apklib ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
D:\worksp\simple\android-test-apklib\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ 
android-test-apklib ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ android-test-apklib 
---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ android-test-apklib ---
[INFO] Building jar: 
D:\worksp\simple\android-test-apklib\target\android-test-apklib.jar
[INFO]
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:apklib (default-apklib) @ 
android-test-apklib ---
[INFO] Generating apklib
[INFO] D:\worksp\simple\android-test-apklib\libs does not exist, looking for 
libraries in target directory.
[INFO] Building jar: 
D:\worksp\simple\android-test-apklib\target\android-test-apklib.apklib
[INFO]
[INFO] --- maven-install-plugin:2.5.1:install (default-install) @ 
android-test-apklib ---
[INFO] Installing 
D:\worksp\simple\android-test-apklib\target\android-test-apklib.apklib to 
D:\Program Files\apache-maven-3.2.1\repository\com\david\a
ndroid-test-apklib\0.0.1-SNAPSHOT\android-test-apklib-0.0.1-SNAPSHOT.apklib
[INFO] Installing D:\worksp\simple\android-test-apklib\pom.xml to D:\Program 
Files\apache-maven-3.2.1\repository\com\david\android-test-apklib\0.0.1-S
NAPSHOT\android-test-apklib-0.0.1-SNAPSHOT.pom
[INFO] Installing 
D:\worksp\simple\android-test-apklib\target\android-test-apklib.jar to 
D:\Program Files\apache-maven-3.2.1\repository\com\david\andr
oid-test-apklib\0.0.1-SNAPSHOT\android-test-apklib-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building android-test-apklib2 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ android-test-apklib2 
---
[INFO] Deleting D:\worksp\simple\android-test-apklib2\target
[INFO]
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:generate-sources 
(default-generate-sources) @ android-test-apklib2 ---
[INFO] Manifest copying disabled. Using default manifest only
[INFO] Extracting libs
[INFO] Extracting apklib android-test-apklib...
[INFO] Manifest merging disabled. Using project manifest only
[INFO] Generating R file for 
com.david:android-test-apklib2:apklib:0.0.1-SNAPSHOT
[INFO] Generating R file for apklibrary: com.david:android-test-apklib
[INFO] Adding R gen folder to compile classpath: 
D:\worksp\simple\android-test-apklib2\target\generated-sources\r
[INFO] Adding AIDL gen folder to compile classpath: 
D:\worksp\simple\android-test-apklib2\target\generated-sources\aidl
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 
android-test-apklib2 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
D:\worksp\simple\android-test-apklib2\src\main\resources
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ 
android-test-apklib2 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 7 source files to 
D:\worksp\simple\android-test-apklib2\target\classes
[INFO]
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:proguard (default-proguard) @ 
android-test-apklib2 ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ 
android-test-apklib2 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
D:\worksp\simple\android-test-apklib2\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ 
android-test-apklib2 ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ 
android-test-apklib2 ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ android-test-apklib2 ---
[INFO] Building jar: 
D:\worksp\simple\android-test-apklib2\target\android-test-apklib2.jar
[INFO]
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:apklib (default-apklib) @ 
android-test-apklib2 ---
[INFO] Generating apklib
[INFO] D:\worksp\simple\android-test-apklib2\libs does not exist, looking for 
libraries in target directory.
[INFO] Building jar: 
D:\worksp\simple\android-test-apklib2\target\android-test-apklib2.apklib
[INFO]
[INFO] --- maven-install-plugin:2.5.1:install (default-install) @ 
android-test-apklib2 ---
[INFO] Installing 
D:\worksp\simple\android-test-apklib2\target\android-test-apklib2.apklib to 
D:\Program Files\apache-maven-3.2.1\repository\com\david
\android-test-apklib2\0.0.1-SNAPSHOT\android-test-apklib2-0.0.1-SNAPSHOT.apklib
[INFO] Installing D:\worksp\simple\android-test-apklib2\pom.xml to D:\Program 
Files\apache-maven-3.2.1\repository\com\david\android-test-apklib2\0.0.1
-SNAPSHOT\android-test-apklib2-0.0.1-SNAPSHOT.pom
[INFO] Installing 
D:\worksp\simple\android-test-apklib2\target\android-test-apklib2.jar to 
D:\Program Files\apache-maven-3.2.1\repository\com\david\an
droid-test-apklib2\0.0.1-SNAPSHOT\android-test-apklib2-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building android-test-apk 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ android-test-apk ---
[INFO] Deleting D:\worksp\simple\android-test-apk\target
[INFO]
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:generate-sources 
(default-generate-sources) @ android-test-apk ---
[INFO] Manifest copying disabled. Using default manifest only
[INFO] Extracting libs
[INFO] Extracting apklib android-test-apklib2...
[INFO] Extracting apklib android-test-apklib...
[INFO] Manifest merging disabled. Using project manifest only
[INFO] Generating R file for com.david:android-test-apk:apk:0.0.1-SNAPSHOT
[INFO] Generating R file for apklibrary: com.david:android-test-apklib2
[INFO] Generating R file for apklibrary: com.david:android-test-apklib
[INFO] Generating R file for apklib : com.david.android.apklib
[INFO] Generating R file for apklib : com.david.android.apklib2
[INFO] Adding R gen folder to compile classpath: 
D:\worksp\simple\android-test-apk\target\generated-sources\r
[INFO] Adding AIDL gen folder to compile classpath: 
D:\worksp\simple\android-test-apk\target\generated-sources\aidl
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 
android-test-apk ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
D:\worksp\simple\android-test-apk\src\main\resources
[INFO] Copying 0 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ 
android-test-apk ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 10 source files to 
D:\worksp\simple\android-test-apk\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] 
/D:/worksp/simple/android-test-apk/target/unpacked-libs/cd_android-test-apklib2/
src/com/david/android/apklib2/HelloAndroidActivity.java:[25,63
] 
D:\worksp\simple\android-test-apk\target\unpacked-libs\cd_android-test-apklib2\s
rc\com\david\android\apklib2\HelloAndroidActivity.java:25: 找不到符
号
符号: 变量 test_apklib2_view
位置: 类 com.david.android.apklib2.R.id
[ERROR] 
/D:/worksp/simple/android-test-apk/target/unpacked-libs/cd_android-test-apklib/s
rc/com/david/android/apklib/HelloAndroidActivity.java:[21,49]
D:\worksp\simple\android-test-apk\target\unpacked-libs\cd_android-test-apklib\sr
c\com\david\android\apklib\HelloAndroidActivity.java:21: 找不到符号
符号: 变量 test_apklib1_view
位置: 类 com.david.android.apklib.R.id
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] simple ............................................ SUCCESS [  0.254 s]
[INFO] android-test-apklib ............................... SUCCESS [  6.428 s]
[INFO] android-test-apklib2 .............................. SUCCESS [  1.225 s]
[INFO] android-test-apk .................................. FAILURE [  1.145 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.699 s
[INFO] Finished at: 2014-05-12T10:32:34+08:00
[INFO] Final Memory: 21M/221M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on 
project android-test-apk: Compilation f
ailure: Compilation failure:
[ERROR] 
/D:/worksp/simple/android-test-apk/target/unpacked-libs/cd_android-test-apklib2/
src/com/david/android/apklib2/HelloAndroidActivity.java:[25,63
] 
D:\worksp\simple\android-test-apk\target\unpacked-libs\cd_android-test-apklib2\s
rc\com\david\android\apklib2\HelloAndroidActivity.java:25: 找不到符
号
[ERROR] 符号: 变量 test_apklib2_view
[ERROR] 位置: 类 com.david.android.apklib2.R.id
[ERROR] 
/D:/worksp/simple/android-test-apk/target/unpacked-libs/cd_android-test-apklib/s
rc/com/david/android/apklib/HelloAndroidActivity.java:[21,49]
D:\worksp\simple\android-test-apk\target\unpacked-libs\cd_android-test-apklib\sr
c\com\david\android\apklib\HelloAndroidActivity.java:21: 找不到符号
[ERROR] 符号: 变量 test_apklib1_view
[ERROR] 位置: 类 com.david.android.apklib.R.id
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please 
read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :android-test-apk

At 
simple\android-test-apk\target\generated-sources\r\com\david\android\apklib\R.ja
va
 it miss test_apklib1_view id.so apk project build failue.
At 
simple\android-test-apklib\target\generated-sources\r\com\david\android\apklib\R
.java have test_apklib1_view id.

Original comment by david.zh...@gmail.com on 12 May 2014 at 3:17

GoogleCodeExporter commented 9 years ago
David can you attach a debug log of that build. Because I can build it just
fine.

Original comment by william....@xandar.com.au on 12 May 2014 at 3:40

GoogleCodeExporter commented 9 years ago
D:\worksp\simple>mvn clean install -Dmaven.test.skip=true -e -X
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 
2014-02-15T01:37:52+08:00)
Maven home: D:\Program Files\apache-maven-3.2.1\bin\..
Java version: 1.6.0_71, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_71\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from D:\Program 
Files\apache-maven-3.2.1\bin\..\conf\settings.xml
...
[INFO] Deleting D:\worksp\simple\android-test-apk\target
[INFO] Deleting file 
D:\worksp\simple\android-test-apk\target\unpacked-libs\cd_android-test-apklib2\s
rc\com\david\android\apklib2\HelloAndroidActivity
.java
[INFO] Deleting directory 
D:\worksp\simple\android-test-apk\target\unpacked-libs\cd_android-test-apklib2\s
rc\com\david\android\apklib2
[INFO] --- android-maven-plugin:3.9.0-SNAPSHOT:generate-sources 
(default-generate-sources) @ android-test-apk ---
[DEBUG] Configuring mojo 
com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.9.0-SNAPSHOT
:generate-sources from plugin realm ClassReal
m[plugin>com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.9.0
-SNAPSHOT, parent: sun.misc.Launcher$AppClassLoader@39172e08]
[DEBUG] copyManifest: null -> 
D:\worksp\simple\android-test-apk\AndroidManifest.xml
[DEBUG] Copying D:\worksp\simple\android-test-apk\assets to 
D:\worksp\simple\android-test-apk\target\generated-sources\combined-assets
[DEBUG] mergeManifests: false
[INFO] Manifest merging disabled. Using project manifest only
[DEBUG] Extracting packageName com.david.android.apk from Manifest : 
D:\worksp\simple\android-test-apk\AndroidManifest.xml
[DEBUG] Extracting packageName com.david.android.apklib2 from Manifest : 
D:\worksp\simple\android-test-apk\target\unpacked-libs\cd_android-test-apklib
2\AndroidManifest.xml
[DEBUG] Extracting packageName com.david.android.apklib from Manifest : 
D:\worksp\simple\android-test-apk\target\unpacked-libs\cd_android-test-apklib\
AndroidManifest.xml
[INFO] Generating R file for com.david:android-test-apk:apk:0.0.1-SNAPSHOT
[DEBUG] Resource overlay folders : 
[D:\worksp\simple\android-test-apk\res-overlay]
[DEBUG]
[DEBUG] #generateCorrectRJavaFoApklibDeps
[DEBUG] Generating Rs for apklib deps of project 
com.david:android-test-apk:apk:0.0.1-SNAPSHOT
[DEBUG] Generating apklib R.java for android-test-apklib2...
[INFO] Generating R file for apklibrary: com.david:android-test-apklib2
[DEBUG] Extracting packageName com.david.android.apklib2 from Manifest : 
D:\worksp\simple\android-test-apk\target\unpacked-libs\cd_android-test-apklib
2\AndroidManifest.xml
[DEBUG] building maven31 dependency graph for 
com.david:android-test-apk:apk:0.0.1-SNAPSHOT
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, 
ConflictMarker.markTime=0, ConflictMarker.nodeCount=13, 
ConflictIdSorter.graphTime
=0, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=11, 
ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=0, Confli
ctResolver.conflictItemCount=12, DefaultDependencyCollector.collectTime=1, 
DefaultDependencyCollector.transformTime=0}
[DEBUG]   (f) compilerId = javac
[DEBUG]   (f) debug = true
[DEBUG]   (f) encoding = UTF-8
[DEBUG]   (f) failOnError = true
[DEBUG]   (f) forceJavacCompilerUse = false
[DEBUG]   (f) fork = false
[DEBUG]   (f) generatedSourcesDirectory = 
D:\worksp\simple\android-test-apk\target\generated-sources\annotations
[DEBUG]   (f) mojoExecution = 
org.apache.maven.plugins:maven-compiler-plugin:3.1:compile {execution: 
default-compile}
[DEBUG]   (f) optimize = false
[DEBUG]   (f) outputDirectory = D:\worksp\simple\android-test-apk\target\classes
[DEBUG]   (f) projectArtifact = com.david:android-test-apk:apk:0.0.1-SNAPSHOT
[DEBUG]   (f) showDeprecation = false
[DEBUG]   (f) showWarnings = false
[DEBUG]   (f) skipMultiThreadWarning = false
[DEBUG]   (f) source = 1.5
[DEBUG]   (f) staleMillis = 0
[DEBUG]   (f) target = 1.5
[DEBUG]   (f) useIncrementalCompilation = true
[DEBUG]   (f) verbose = false
[DEBUG]   (f) mavenSession = org.apache.maven.execution.MavenSession@6f0c29fe
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@6f0c29fe
[DEBUG] -- end configuration --
[DEBUG] Using compiler 'javac'.
[DEBUG] Source directories: [D:\worksp\simple\android-test-apk\src\main\java
 D:\worksp\simple\android-test-apk\target\unpacked-libs\cd_android-test-apklib2\src
 D:\worksp\simple\android-test-apk\target\unpacked-libs\cd_android-test-apklib\src
 D:\worksp\simple\android-test-apk\target\generated-sources\r
 D:\worksp\simple\android-test-apk\target\generated-sources\aidl]
[DEBUG] Classpath: [D:\worksp\simple\android-test-apk\target\classes
 D:\Program Files\apache-maven-3.2.1\repository\com\google\android\android\4.1.1.4\android-4.1.1.4.jar
 D:\Program Files\apache-maven-3.2.1\repository\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar
 D:\Program Files\apache-maven-3.2.1\repository\org\apache\httpcomponents\httpclient\4.0.1\httpclient-4.0.1.jar
 D:\Program Files\apache-maven-3.2.1\repository\org\apache\httpcomponents\httpcore\4.0.1\httpcore-4.0.1.jar
 D:\Program Files\apache-maven-3.2.1\repository\commons-codec\commons-codec\1.3\commons-codec-1.3.jar
 D:\Program Files\apache-maven-3.2.1\repository\org\khronos\opengl-api\gl1.1-android-2.1_r1\opengl-api-gl1.1-android-2.1_r1.jar
 D:\Program Files\apache-maven-3.2.1\repository\xerces\xmlParserAPIs\2.6.2\xmlParserAPIs-2.6.2.jar
 D:\Program Files\apache-maven-3.2.1\repository\xpp3\xpp3\1.1.4c\xpp3-1.1.4c.jar
 D:\Program Files\apache-maven-3.2.1\repository\org\json\json\20080701\json-20080701.jar]
[DEBUG] Output directory: D:\worksp\simple\android-test-apk\target\classes
[DEBUG] CompilerReuseStrategy: reuseCreated
[DEBUG] useIncrementalCompilation enabled
[DEBUG] Stale source detected: 
D:\worksp\simple\android-test-apk\target\unpacked-libs\cd_android-test-apklib2\s
rc\com\david\android\apklib2\HelloAndro
idActivity.java
[DEBUG] Stale source detected: 
D:\worksp\simple\android-test-apk\target\unpacked-libs\cd_android-test-apklib\sr
c\com\david\android\apklib\StringUtil.j
ava
[DEBUG] Stale source detected: 
D:\worksp\simple\android-test-apk\target\generated-sources\r\com\david\android\a
pklib\BuildConfig.java
[DEBUG] Stale source detected: 
D:\worksp\simple\android-test-apk\target\generated-sources\r\com\david\android\a
pklib2\BuildConfig.java
[DEBUG] Stale source detected: 
D:\worksp\simple\android-test-apk\src\main\java\com\david\android\apk\HelloAndro
idActivity.java
[DEBUG] Stale source detected: 
D:\worksp\simple\android-test-apk\target\generated-sources\r\com\david\android\a
pklib2\R.java
[DEBUG] Stale source detected: 
D:\worksp\simple\android-test-apk\target\generated-sources\r\com\david\android\a
pklib\R.java
[DEBUG] Stale source detected: 
D:\worksp\simple\android-test-apk\target\generated-sources\r\com\david\android\a
pk\BuildConfig.java
[DEBUG] Stale source detected: 
D:\worksp\simple\android-test-apk\target\unpacked-libs\cd_android-test-apklib\sr
c\com\david\android\apklib\HelloAndroid
Activity.java
[DEBUG] Stale source detected: 
D:\worksp\simple\android-test-apk\target\generated-sources\r\com\david\android\a
pk\R.java
[INFO] Changes detected - recompiling the module!
[DEBUG] Classpath:
[DEBUG]  D:\worksp\simple\android-test-apk\target\classes
[DEBUG]  D:\Program 
Files\apache-maven-3.2.1\repository\com\google\android\android\4.1.1.4\android-4
.1.1.4.jar
[DEBUG]  D:\Program 
Files\apache-maven-3.2.1\repository\commons-logging\commons-logging\1.1.1\common
s-logging-1.1.1.jar
[DEBUG]  D:\Program 
Files\apache-maven-3.2.1\repository\org\apache\httpcomponents\httpclient\4.0.1\h
ttpclient-4.0.1.jar
[DEBUG]  D:\Program 
Files\apache-maven-3.2.1\repository\org\apache\httpcomponents\httpcore\4.0.1\htt
pcore-4.0.1.jar
[DEBUG]  D:\Program 
Files\apache-maven-3.2.1\repository\commons-codec\commons-codec\1.3\commons-code
c-1.3.jar
[DEBUG]  D:\Program 
Files\apache-maven-3.2.1\repository\org\khronos\opengl-api\gl1.1-android-2.1_r1\
opengl-api-gl1.1-android-2.1_r1.jar
[DEBUG]  D:\Program 
Files\apache-maven-3.2.1\repository\xerces\xmlParserAPIs\2.6.2\xmlParserAPIs-2.6
.2.jar
[DEBUG]  D:\Program 
Files\apache-maven-3.2.1\repository\xpp3\xpp3\1.1.4c\xpp3-1.1.4c.jar
[DEBUG]  D:\Program 
Files\apache-maven-3.2.1\repository\org\json\json\20080701\json-20080701.jar
[DEBUG] Source roots:
[DEBUG]  D:\worksp\simple\android-test-apk\src\main\java
[DEBUG]  
D:\worksp\simple\android-test-apk\target\unpacked-libs\cd_android-test-apklib2\s
rc
[DEBUG]  
D:\worksp\simple\android-test-apk\target\unpacked-libs\cd_android-test-apklib\sr
c
[DEBUG]  D:\worksp\simple\android-test-apk\target\generated-sources\r
[DEBUG]  D:\worksp\simple\android-test-apk\target\generated-sources\aidl
[DEBUG] Command line options:
[DEBUG] -d D:\worksp\simple\android-test-apk\target\classes -classpath 
D:\worksp\simple\android-test-apk\target\classes;D:\Program Files\apache-maven-
3.2.1\repository\com\google\android\android\4.1.1.4\android-4.1.1.4.jar;D:\Progr
am Files\apache-maven-3.2.1\repository\commons-logging\commons-logging
\1.1.1\commons-logging-1.1.1.jar;D:\Program 
Files\apache-maven-3.2.1\repository\org\apache\httpcomponents\httpclient\4.0.1\h
ttpclient-4.0.1.jar;D:\Pro
gram 
Files\apache-maven-3.2.1\repository\org\apache\httpcomponents\httpcore\4.0.1\htt
pcore-4.0.1.jar;D:\Program Files\apache-maven-3.2.1\repository\co
mmons-codec\commons-codec\1.3\commons-codec-1.3.jar;D:\Program 
Files\apache-maven-3.2.1\repository\org\khronos\opengl-api\gl1.1-android-2.1_r1\
opengl-
api-gl1.1-android-2.1_r1.jar;D:\Program 
Files\apache-maven-3.2.1\repository\xerces\xmlParserAPIs\2.6.2\xmlParserAPIs-2.6
.2.jar;D:\Program Files\apache
-maven-3.2.1\repository\xpp3\xpp3\1.1.4c\xpp3-1.1.4c.jar;D:\Program 
Files\apache-maven-3.2.1\repository\org\json\json\20080701\json-20080701.jar; 
-sou
rcepath 
D:\worksp\simple\android-test-apk\src\main\java;D:\worksp\simple\android-test-ap
k\target\unpacked-libs\cd_android-test-apklib2\src;D:\worksp\s
imple\android-test-apk\target\unpacked-libs\cd_android-test-apklib\src;D:\worksp
\simple\android-test-apk\target\generated-sources\r;D:\worksp\simple\a
ndroid-test-apk\target\generated-sources\aidl; -g -nowarn -target 1.5 -source 
1.5 -encoding UTF-8
[DEBUG] incrementalBuildHelper#beforeRebuildExecution
[INFO] Compiling 10 source files to 
D:\worksp\simple\android-test-apk\target\classes
[DEBUG] incrementalBuildHelper#afterRebuildExecution
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] 
/D:/worksp/simple/android-test-apk/target/unpacked-libs/cd_android-test-apklib2/
src/com/david/android/apklib2/HelloAndroidActivity.java:[25,63
] 
D:\worksp\simple\android-test-apk\target\unpacked-libs\cd_android-test-apklib2\s
rc\com\david\android\apklib2\HelloAndroidActivity.java:25: 找不到符
号
符号: 变量 test_apklib2_view
位置: 类 com.david.android.apklib2.R.id
[ERROR] 
/D:/worksp/simple/android-test-apk/target/unpacked-libs/cd_android-test-apklib/s
rc/com/david/android/apklib/HelloAndroidActivity.java:[21,49]
D:\worksp\simple\android-test-apk\target\unpacked-libs\cd_android-test-apklib\sr
c\com\david\android\apklib\HelloAndroidActivity.java:21: 找不到符号
符号: 变量 test_apklib1_view
位置: 类 com.david.android.apklib.R.id
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] simple ............................................ SUCCESS [  0.661 s]
[INFO] android-test-apklib ............................... SUCCESS [  7.350 s]
[INFO] android-test-apklib2 .............................. SUCCESS [  4.151 s]
[INFO] android-test-apk .................................. FAILURE [  3.838 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.239 s
[INFO] Finished at: 2014-05-12T14:38:28+08:00
[INFO] Final Memory: 19M/110M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on 
project android-test-apk: Compilation f
ailure: Compilation failure:
[ERROR] 
/D:/worksp/simple/android-test-apk/target/unpacked-libs/cd_android-test-apklib2/
src/com/david/android/apklib2/HelloAndroidActivity.java:[25,63
] 
D:\worksp\simple\android-test-apk\target\unpacked-libs\cd_android-test-apklib2\s
rc\com\david\android\apklib2\HelloAndroidActivity.java:25: 找不到符
号
[ERROR] 符号: 变量 test_apklib2_view
[ERROR] 位置: 类 com.david.android.apklib2.R.id
[ERROR] 
/D:/worksp/simple/android-test-apk/target/unpacked-libs/cd_android-test-apklib/s
rc/com/david/android/apklib/HelloAndroidActivity.java:[21,49]
D:\worksp\simple\android-test-apk\target\unpacked-libs\cd_android-test-apklib\sr
c\com\david\android\apklib\HelloAndroidActivity.java:21: 找不到符号
[ERROR] 符号: 变量 test_apklib1_view
[ERROR] 位置: 类 com.david.android.apklib.R.id
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-com
pile) on project android-test-apk: Compilation failure
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
        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:108)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
        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.compiler.CompilationFailureException: 
Compilation failure
        at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:858)
        at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 19 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please 
read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :android-test-apk
D:\worksp\simple>

Original comment by david.zh...@gmail.com on 12 May 2014 at 7:07

Attachments:

GoogleCodeExporter commented 9 years ago
Hi
All debug info is too long to a comment,I had to delete some logs.I hope I had 
not delete important logs.

Original comment by david.zh...@gmail.com on 12 May 2014 at 7:13

GoogleCodeExporter commented 9 years ago
update simple project.

Original comment by david.zh...@gmail.com on 12 May 2014 at 7:21

Attachments:

GoogleCodeExporter commented 9 years ago
Oh,I can upload a debug info file. 

Original comment by david.zh...@gmail.com on 12 May 2014 at 7:32

Attachments:

GoogleCodeExporter commented 9 years ago
David, you are getting the failure about missing 
com.david.android.apklib.R.id.test_apklib1_view because you have misconfigured 
the packageName in android-test-apk/AndroidManifest.xml. 

It has the same package name as that used in 
android-test-apklib/AndroidManifest.xml. They have to be distinct according to 
the Android build rules. aapt will generate invalide resource files (which is 
what is occurring). If you change the package to com.david.android.apk then 
compilation proceeds.

Original comment by william....@xandar.com.au on 14 May 2014 at 2:38

GoogleCodeExporter commented 9 years ago
In fact, there is a build warning to that effect:

[WARNING] Duplicate packages detected in next artifacts:
    artifacts: "android-test-apk" "android-test-apklib" have similar package: com.david.android.apklib

Original comment by william....@xandar.com.au on 14 May 2014 at 2:48

GoogleCodeExporter commented 9 years ago
  I checked my project android-test-apk and android-test-apklib,the packageName is correct。
android-test-apk  -> package="com.david.android.apk"
android-test-apklib -> package="com.david.android.apklib"
android-test-apklib2 -> package="com.david.android.apklib2"
There are different.

Original comment by david.zh...@gmail.com on 15 May 2014 at 3:43

GoogleCodeExporter commented 9 years ago
No. The last zip you uploaded is not correct.
android-test-apk  -> package="com.david.android.apklib"
android-test-apklib -> package="com.david.android.apklib"
android-test-apklib2 -> package="com.david.android.apklib2"

Original comment by william....@xandar.com.au on 15 May 2014 at 3:46

GoogleCodeExporter commented 9 years ago
Can I suggest that if you still believe there is a problem that you post
your failing project to github so that we can agree on what we are testing
against.

On Thu, May 15, 2014 at 1:46 PM, William Ferguson <
william.ferguson@xandar.com.au> wrote:

Original comment by william....@xandar.com.au on 15 May 2014 at 3:48

GoogleCodeExporter commented 9 years ago
The last zip is correct,I download it against and checked.I don't know why you 
get it is not correct. it's too strange. I am uploaded once again.

Original comment by david.zh...@gmail.com on 15 May 2014 at 6:10

Attachments:

GoogleCodeExporter commented 9 years ago
David, I have come to the conclusion that what you are asking for is not 
possible.
The problem is that you have identically named layouts and these layouts 
contain resource ids that you are attempting to use.

When appt attempts to generate the R.txt for the apk (which contains the 
resources for the project + all dependencies) all the resource folders are put 
on the appt command line using the "-S" argument. Aapt uses a left to right 
precedence to determine which resource file are loaded when there are 
duplicates. So the APK activity_main.xml gets precedence and the resources id 
from the other two activity_main.xml files are never loaded.

The project R.txt generated above is what is then used to populate the R.java 
files with the correct resource values.

I have included the aapt command line below. If you can provide an aapt command 
line that generates a project R.txt containing all the resources then I will 
swap it in. But I don't think such a thing exists.

D:\Dev\Android-sdk\build-tools\19.0.3\aapt.exe ^
package -f --no-crunch ^
-I D:\Dev\Android-sdk\platforms\android-16\android.jar ^
-M D:\Temp\issue-463-simple-3\android-test-apk\AndroidManifest.xml ^
-S D:\Temp\issue-463-simple-3\android-test-apk\res ^
-S 
D:\Temp\issue-463-simple-3\android-test-apk\target\unpacked-libs\cd_android-test
-apklib2\res ^
-S 
D:\Temp\issue-463-simple-3\android-test-apk\target\unpacked-libs\cd_android-test
-apklib\res ^
-A 
D:\Temp\issue-463-simple-3\android-test-apk\target\generated-sources\combined-as
sets ^
-m -J D:\Temp\issue-463-simple-3\android-test-apk\target\generated-sources\r ^
--output-text-symbols D:\Temp\issue-463-simple-3\android-test-apk\target ^
--auto-add-overlay

Original comment by william....@xandar.com.au on 15 May 2014 at 3:20

GoogleCodeExporter commented 9 years ago
Hi
   Yes,you are right,If you use this plug-in, then all the project layout files can not have the same name. However, this can be compiled by the ADT,but you can not use the com.david.android.apklib.R.id.test_apklib1_view,because it really does not exist when I decompile the apk classes.dex.I think ADT ignored this error compilation.Thanks!

Original comment by david.zh...@gmail.com on 16 May 2014 at 4:00

GoogleCodeExporter commented 9 years ago
Pull request https://github.com/jayway/maven-android-plugin/pull/352 will fail 
the build (by default) if there are duplicate layout files across dependencies.

It can be overriden (by why would you want to) by specifying 
failOnConclictingLayouts=false

Original comment by william....@xandar.com.au on 16 May 2014 at 11:26