开发者

No resource found in Android project using a Library Project

We are using Maven-Android-Plugin to compile an Android project that uses a Library Project.

Because the plugin doesn't support yet the Library project type of package, We're using this modification of the plugin.

When compiling the main project We get this error:

[INFO] /home/win1frogtek/androidSDK/platform-tools/aapt [package, -m, -J, /home/win1frogtek/workspaceBranch/conoceTuTienda/target/generated-sources/gen, -M, /home/win1frogtek/workspaceBranch/conoceTuTienda/target/generated-sources/apklibs/libtek/AndroidManifest.xml, -S, /home/win1frogtek/workspaceBranch/conoceTuTienda/res, -S, /home/win1frogtek/workspaceBranch/conoceTuTienda/target/generated-sources/apklibs/libtek/res, --auto-add-overlay, -A, /home/win1frogtek/workspaceBranch/conoceTuTienda/assets, -I, /home/win1frogtek/androidSDK/platforms/android-4/android.jar]
[INFO] /home/win1frogtek/workspaceBranch/conoceTuTienda/res/layout/screen_play_home.xml:72: error: No resource identifier found for attribute 'maxPoints' in package 'org.frogtek.conoceTuTienda'
[ERROR] Error when generating sources.
org.apache.maven.plugin.MojoExecutionException: 
    at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateRForManifest(GenerateSourcesMojo.java:455)
    at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateApklibR(GenerateSourcesMojo.java:410)
    at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:135)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
    at org.apache.maven.lifecycle.De开发者_JAVA百科faultLifecycleExecutor.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: com.jayway.maven.plugins.android.ExecutionException: ANDROID-040-001: Could not execute: Command = /bin/sh -c cd /home/win1frogtek/workspaceBranch/conoceTuTienda && /home/win1frogtek/androidSDK/platform-tools/aapt package -m -J /home/win1frogtek/workspaceBranch/conoceTuTienda/target/generated-sources/gen -M /home/win1frogtek/workspaceBranch/conoceTuTienda/target/generated-sources/apklibs/libtek/AndroidManifest.xml -S /home/win1frogtek/workspaceBranch/conoceTuTienda/res -S /home/win1frogtek/workspaceBranch/conoceTuTienda/target/generated-sources/apklibs/libtek/res --auto-add-overlay -A /home/win1frogtek/workspaceBranch/conoceTuTienda/assets -I /home/win1frogtek/androidSDK/platforms/android-4/android.jar, Result = 1
    at com.jayway.maven.plugins.android.CommandExecutor$Factory$1.executeCommand(CommandExecutor.java:186)
    at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateRForManifest(GenerateSourcesMojo.java:453)
    ... 21 more

We're using a custom widget, something like this:

  • attrs.xml in the main project

  • any layout in the main project...

    <org.frogtek.conoceTuTienda.widgets.MedalWidget android:id="@+id/ct_manejas_medal"
        android:layout_marginTop="200px" android:layout_marginLeft="25px"
        android:background="@drawable/ct_play_medal_empty" frogtek:maxPoints="4"
        android:layout_width="wrap_content" android:layout_height="wrap_content">
    </org.frogtek.conoceTuTienda.widgets.MedalWidget>
    

I've done some tests and changes and apparently is a plugin related problem, the same code without a dependecy to an apklib (package type for a Library Proejct) works just fine.

Can anybody help me with this? Some workaround or idea?

Thank you for any clue or help.

PD: I will post this to the developers group of the plugin too.


The Maven Android plugin was recently updated to 2.9.0-beta-1 with support for library projects. Try that one out and see if it helps.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜