我試圖用離子,所以我需要使用這個庫錯誤而進口在github上庫到Android的
我下載的zip文件,提取它放入我的項目的根目錄中的文件名爲子項目中(僅離子文件夾沒有其他兩個)然後在我的settings.gradle我加
include ':app',':subProject:ion'
我給了一個錯誤,說書中有沒有有效的路徑,以便項目不能進行清洗。然後,我改變了它,並添加編譯語句的build.gradle
include ':app',':subProject'
compile project(':subProject:ion')
但是當我嘗試使用Ion.something它告訴我,它給了我一個錯誤,因爲它無法解析離子是什麼。我如何導入?我的方式做它是在互聯網上的解決方案,但它未能
這裏的時候,我得到了未知的符號錯誤我嘗試的代碼使用等
Ion.with(getApplicationContext())
.load("http://www.example.com/abc/def/")
.setBodyParameter("identifier", "foo")
.setBodyParameter("email", "[email protected]")
.setBodyParameter("password", "[email protected]")
.asString()
.setCallback(new FutureCallback<String>() {
@Override
public void onCompleted(Exception e, String result) {
// Result
}
});
你爲什麼下載並提取它。閱讀自述文件,使用Gradle。 https://github.com/koush/ion#gradle –
只需使用'依賴項'編譯'com.koushikdutta.ion:ion'2. +' }' – Basi
使用這個時應該將項目下載到主根? – Prethia