2011-03-23 62 views
0

嘗試了一個樣本項目johannilssons android-actionbar plugin,它工作正常。嘗試了另一個項目,並得到這個錯誤。關於如何着手定位錯誤來源的想法?Android ActionBar導致構建錯誤(找不到資源)

[INFO] Scanning for projects... 
[INFO]                   
[INFO] ------------------------------------------------------------------------ 
[INFO] Building HSR Android Frontend 0.0.1-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- maven-android-plugin:2.8.4:generate-sources (default-generate-sources) @ frontend-module --- 
[INFO] ANDROID-904-002: Found aidl files: Count = 0 
[INFO] ANDROID-904-002: Found aidl files: Count = 0 
[INFO] Copying local resource files to combined resource directory. 
[INFO] C:\Google\android-sdk-windows/platform-tools/aapt.exe [package, -m, -J, C:\Users\Love\workspace\HSR\HSR\frontend-module\target\generated-sources\r, -M, C:\Users\Love\workspace\HSR\HSR\frontend-module\AndroidManifest.xml, -S, C:\Users\Love\workspace\HSR\HSR\frontend-module\target\generated-sources\combined-resources\res, -I, C:\Google\android-sdk-windows\platforms\android-7\android.jar] 
[INFO] C:\Users\Love\workspace\HSR\HSR\frontend-module\target\generated-sources\combined-resources\res\layout\main.xml:18: error: Error: No resource found that matches the given name (at 'style' with value '@style/ActionBar'). 
[ERROR] Error when generating sources. 
org.apache.maven.plugin.MojoExecutionException: 
    at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:313) 
    at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:111) 
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) 
    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:319) 
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) 
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534) 
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) 
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) 
    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:290) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) 
Caused by: com.jayway.maven.plugins.android.ExecutionException: ANDROID-040-001: Could not execute: Command = cmd.exe /X /C "C:\Google\android-sdk-windows\platform-tools\aapt.exe package -m -J C:\Users\Love\workspace\HSR\HSR\frontend-module\target\generated-sources\r -M C:\Users\Love\workspace\HSR\HSR\frontend-module\AndroidManifest.xml -S C:\Users\Love\workspace\HSR\HSR\frontend-module\target\generated-sources\combined-resources\res -I C:\Google\android-sdk-windows\platforms\android-7\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.generateR(GenerateSourcesMojo.java:311) 
    ... 22 more 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 

回答

0

確保您的res/values/styles.xml具有ActionBar風格。

+0

示例應用程序沒有這樣的定義... [github](https://github.com/johannilsson/android-actionbar/blob/master/actionbarexample/res/values/styles.xml) – u2ix 2011-08-29 19:16:10

相關問題