標籤:androi cdir url srcdir hub 下載 files enter err
// 聲明是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,硬加上的。不知道怎麼設定全域的,否則建立個新項目就卡住不動了。
Mac上操作 androidStudio