Android Studio 2.2.2匯入Eclipse中建立的項目,androideclipse

來源:互聯網
上載者:User

Android Studio 2.2.2匯入Eclipse中建立的項目,androideclipse

最近隨視頻教程學習Android,原本都是用Adt寫Android程式,中途教程換成了Android Studio,於是我自己下了android studio 2.2.2安裝好,並下載好sdk,也跟著更換開發環境。

但教程並未講解如何將舊有的Eclipse項目匯入到Android Studio(以下簡稱as)中。

自己花了一整天的時間,在網上找相關文章,發現都不能完全解決問題,可能是因為新版本的as相關文章較少吧。所以在費了好一番周折自己一步步試著匯入,初步搞定後,記錄一下匯入時遇見的問題及解決方案。

 

as 啟動介面上有 Android Studio - Import project(Eclipse ADT, Gradle, etc.) 選項,就是用來匯入Eclipse項目的,這是全新的Android Gradle Project匯入方式。

但不能直接匯入Eclipse編寫的項目,這樣匯入完成後會導致報錯

Could not find method android() for arguments [build_9xx8trk5589b51rsvzzdwphd5$_run_closure2@3c62b433] on root project 'xxxxxx' of type org.gradle.api.Project.

查了好久,也未找到解決方案,甚至提到這個錯誤的文章都很少。

於是改用第二種方式,相容Eclipse的匯入方式。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.