hoge66的专栏

-----------------------看到专栏,偷着笑!
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Mac上操作 androidStudio

Posted on   hehoge  阅读(523)  评论(0编辑  收藏  举报
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// 声明是Android程序
apply plugin: 'com.android.application'
 
android {
    signingConfigs {
    }
    compileSdkVersion 21
    buildToolsVersion '25.0.0'
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }
 
        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')
 
        
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
    defaultConfig {
        applicationId "com.wbh.hoge.crmapp"
        minSdkVersion 21
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
        manifestPlaceholders = [UMENG_CHANNEL_VALUE: "channel_name"]
    }
    //移除lint检查的error
    lintOptions {
        abortOnError false
    }
    buildTypes {
        release {
            // 是否进行混淆
            minifyEnabled false
            // 混淆文件的位置
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors.all { flavor ->
        flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name]
    }
 
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
 
}
 
dependencies {
    // compile 'com.umeng:fb:5.4.0'
    compile 'com.android.support:support-v4:21.+'
    compile fileTree(include: '*.jar', dir: 'libs')
    compile 'com.jiechic.library:xUtils:2.6.14'
    //compile files('libs/wbh-adapter-0.0.1-SNAPSHOT.jar')
    compile files('libs/universal-image-loader-1.9.5.jar')
}
repositories {
    jcenter()
    maven { url "https://raw.githubusercontent.com/umeng/mvn-repo-umeng/master/repository" }
}

这是无错的一个配置,真是费劲,好几天了,都不行,终于可以了;

gradle 这个插件,将从网上下载的文件,放到对应的文件夹下了:

 

/Applications/Android Studio.app/Contents/gradle/gradle-3.3

原本该路径中是没有gradle-3.3,硬加上的。不知道怎么设置全局的,否则建立个新项目就卡住不动了。

努力加载评论中...
点击右上角即可分享
微信分享提示