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

Bài đăng

Hiển thị các bài đăng có nhãn android studio

[React Native] Exception when start Android Simulator

When Start android Simulator for React Native code, may be we meet this error: Starting JS server... Building and installing the app on the device (cd android && ./gradlew installDebug)... Downloading https://services.gradle.org/distributions/gradle-2.4-all.zip Exception in thread "main" java.net.ConnectException: Connection refused     at java.net.PlainSocketImpl.socketConnect(Native Method)     at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)     at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)     at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)     at java.net.Socket.connect(Socket.java:589)     at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:649)     at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocke...

[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...