Android问题笔记

1 Post请求失败

  • 异常
    W/System.err: java.net.SocketException: socket failed: EACCES (Permission denied)

  • 原因
    权限不够
    在文件清单中添加uses-permission

  • 方案




    
        
        
    
    

2 Gradle下载失败

  • 场景
    首次使用Android Studio新建Andorid项目,Gradle下载相关组件时过慢或失败
  • 方案
    添加下载源,修改第一层文件夹下的build.gradle文件,添加maven{url ‘http://maven.aliyun.com/nexus/content/groups/public/’},完整问文件如下:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.0.1"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

你可能感兴趣的:(Android,Android,Android,Studio)