Chuyển đến nội dung chính

Bài đăng

Đang hiển thị bài đăng từ Tháng 2, 2017

[Android Studio] Add *.jar file into project

Bước 1 : Copy tất cả *.jar vào thư mục libs   Bước 2 : Tại khu vực Navigator, chọn view ở mode Project : Bước 3 : Click chuột phải vào file *.jar trong thực mục libs , chọn ' Add as library ' Bước 4 : Trong file build.gradle của ứng dụng, thêm dòng: compile fileTree( include : [ '*.jar' ], dir : 'libs' ) Bước 5 : Clean Project và Build ------------------------------------ Step 1: Put the *.jar (example:  gson-2.2.4.jar ) into the  libs  folder Step 2: Right click it and hit 'Add as library' Step 3: Ensure that  compile files('libs/gson-2.2.4.jar')  is in your  build.gradle  file (or  compile fileTree(dir: 'libs', include: '*.jar')  if you are using many jar files) Step 4 : Do a clean build (you can probably do this fine in Android Studio, but to make sure I navigated in a terminal to the root folder of my app and typed  gradlew clean . I'm on Mac OS X, the command might be different on your s