0

我正在使用 ActionBarSherlock、Scala、Sbt 和 android-plugin。当它突然无法编译时,一切都正常工作。我使用 git 回退到之前工作的先前提交,它仍然会抛出以下 12 个错误。然后,我记得我的 Mac OS 更新了,我检查了更新的内容。看来我的 Java 已经从 1.6.0_37 更新到 1.6.0_41,使用 OS X 2013-001 的新 Java。

使用此特定版本的其他人有问题吗?我应该如何解决这个问题?

> compile
[info] extracting apklib actionbarsherlock-4.2.0.apklib
[info] Wrote /Users/Laimiux/scala-rest-client/target/scala-2.9.2/src_managed/main/scala/com/limeblast/mydeatree/TR.scala
[info] generated 84 source files from 1 apklibs
[info] Compiling 36 Scala sources and 87 Java sources to /Users/Laimiux/scala-rest-client/target/scala-2.9.2/classes...
[warn] /Users/Laimiux/scala-rest-client/src/main/scala/IdeaEditActivity.scala:32: value FILL_PARENT in object LayoutParams is deprecated: see corresponding Javadoc for more information.
[warn]     getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)
[warn]                                        ^
[error] /Users/Laimiux/scala-rest-client/target/scala-2.9.2/src_managed/main/java/com/actionbarsherlock/app/SherlockFragment.java:11: OnCreateOptionsMenuListener is not a member of com.actionbarsherlock.app.SherlockFragmentActivity
[error] import static com.actionbarsherlock.app.SherlockFragmentActivity.OnCreateOptionsMenuListener;
[error]        ^
[error] /Users/Laimiux/scala-rest-client/target/scala-2.9.2/src_managed/main/java/com/actionbarsherlock/app/SherlockFragment.java:15: not found: type OnCreateOptionsMenuListener
[error] public class SherlockFragment extends Fragment implements OnCreateOptionsMenuListener, OnPrepareOptionsMenuListener, OnOptionsItemSelectedListener {
[error]                                                           ^
[error] /Users/Laimiux/scala-rest-client/target/scala-2.9.2/src_managed/main/java/com/actionbarsherlock/app/SherlockFragment.java:13: OnPrepareOptionsMenuListener is not a member of com.actionbarsherlock.app.SherlockFragmentActivity
[error] import static com.actionbarsherlock.app.SherlockFragmentActivity.OnPrepareOptionsMenuListener;
[error]        ^
[error] /Users/Laimiux/scala-rest-client/target/scala-2.9.2/src_managed/main/java/com/actionbarsherlock/app/SherlockFragment.java:15: not found: type OnPrepareOptionsMenuListener
[error] public class SherlockFragment extends Fragment implements OnCreateOptionsMenuListener, OnPrepareOptionsMenuListener, OnOptionsItemSelectedListener {
[error]                                                                                        ^
[error] /Users/Laimiux/scala-rest-client/target/scala-2.9.2/src_managed/main/java/com/actionbarsherlock/app/SherlockFragment.java:12: OnOptionsItemSelectedListener is not a member of com.actionbarsherlock.app.SherlockFragmentActivity
[error] import static com.actionbarsherlock.app.SherlockFragmentActivity.OnOptionsItemSelectedListener;
[error]        ^
[error] /Users/Laimiux/scala-rest-client/target/scala-2.9.2/src_managed/main/java/com/actionbarsherlock/app/SherlockFragment.java:15: not found: type OnOptionsItemSelectedListener
[error] public class SherlockFragment extends Fragment implements OnCreateOptionsMenuListener, OnPrepareOptionsMenuListener, OnOptionsItemSelectedListener {
[error]                                                                                                                      ^
[error] /Users/Laimiux/scala-rest-client/target/scala-2.9.2/src_managed/main/java/com/actionbarsherlock/app/SherlockListFragment.java:11: OnCreateOptionsMenuListener is not a member of com.actionbarsherlock.app.SherlockFragmentActivity
[error] import static com.actionbarsherlock.app.SherlockFragmentActivity.OnCreateOptionsMenuListener;
[error]        ^
[error] /Users/Laimiux/scala-rest-client/target/scala-2.9.2/src_managed/main/java/com/actionbarsherlock/app/SherlockListFragment.java:15: not found: type OnCreateOptionsMenuListener
[error] public class SherlockListFragment extends ListFragment implements OnCreateOptionsMenuListener, OnPrepareOptionsMenuListener, OnOptionsItemSelectedListener {
[error]                                                                   ^
[error] /Users/Laimiux/scala-rest-client/target/scala-2.9.2/src_managed/main/java/com/actionbarsherlock/app/SherlockListFragment.java:13: OnPrepareOptionsMenuListener is not a member of com.actionbarsherlock.app.SherlockFragmentActivity
[error] import static com.actionbarsherlock.app.SherlockFragmentActivity.OnPrepareOptionsMenuListener;
[error]        ^
[error] /Users/Laimiux/scala-rest-client/target/scala-2.9.2/src_managed/main/java/com/actionbarsherlock/app/SherlockListFragment.java:15: not found: type OnPrepareOptionsMenuListener
[error] public class SherlockListFragment extends ListFragment implements OnCreateOptionsMenuListener, OnPrepareOptionsMenuListener, OnOptionsItemSelectedListener {
[error]                                                                                                ^
[error] /Users/Laimiux/scala-rest-client/target/scala-2.9.2/src_managed/main/java/com/actionbarsherlock/app/SherlockListFragment.java:12: OnOptionsItemSelectedListener is not a member of com.actionbarsherlock.app.SherlockFragmentActivity
[error] import static com.actionbarsherlock.app.SherlockFragmentActivity.OnOptionsItemSelectedListener;
[error]        ^
[error] /Users/Laimiux/scala-rest-client/target/scala-2.9.2/src_managed/main/java/com/actionbarsherlock/app/SherlockListFragment.java:15: not found: type OnOptionsItemSelectedListener
[error] public class SherlockListFragment extends ListFragment implements OnCreateOptionsMenuListener, OnPrepareOptionsMenuListener, OnOptionsItemSelectedListener {
[error]                                                                                                                              ^
[warn] /Users/Laimiux/scala-rest-client/src/main/scala/NewIdeaActivity.scala:38: value FILL_PARENT in object LayoutParams is deprecated: see corresponding Javadoc for more information.
[warn]     getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)
[warn]                                        ^
[warn] two warnings found
[error] 12 errors found
[error] (Scala-Rest-Client/compile:compile) Compilation failed
[error] Total time: 7 s, completed Feb 27, 2013 11:32:58 PM
> 
4

1 回答 1

1

我不确定是什么导致了这个问题,但我修复了它。我首先测试了创建常规 Android 项目并添加 ActionBarSherlock。它编译!然后,我想创建一个新的 Scala Android 项目,并在其中添加了 ActionBarSherlock。它也编译了!所以,我复制了所有的旧资源,java/scala 文件。更新了 AndroidManifest。项目编译,构建并再次工作!

似乎我的项目文件夹已损坏或类似的东西。

于 2013-02-28T21:21:07.507 回答