Android SDK 1.5 “–core-library” build error問題解決方案

來源:互聯網
上載者:User

如果你手工配置build path,把SDK1.5的android.jar加入到某些工程中,你可能會遇到下面的編譯錯誤:

> Attempt to include a core VM class in something other than a core
> library.
> It is likely that you have attempted to include the core library from
> a desktop
> virtual machine into an application, which will most assuredly not
> work. If
> you really intend to build a core library -- which is only appropriate
> as
> part of creating a full virtual machine binary, as opposed to
> compiling an
> application -- then use the "--core-library" option to suppress this
> error
> message. If you go ahead and use "--core-library" but are in fact
> building
> an application, then please be aware that your build will still fail
> at some
> point; you will simply be denied the pleasure of reading this helpful
> error
> message.
>

 

這意味著你想把一個案頭VM中的類運用到android應用程式中,比如java.awt.*, java.swing.*, java.bean等。

可用android包參見:available packages on Android,這肯定是不行的。

 

為瞭解決這個問題,需要修改工程目錄下的.classpath檔案,把其中的path設定成下面的值即可:

<classpathentry kind="con"
path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.