app build.gradel
apply plugin: 'com.android.application'
//apply plugin: 'me.tatarka.retrolambda'
def AAVersion = '3.3.2'
buildscript {
repositories {
mavenCentral()
}
dependencies {
// classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}
repositories {
mavenCentral()
mavenLocal()
jcenter()
maven {
url 'http://maven.localytics.com/public'
}
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
android {
compileSdkVersion 26
buildToolsVersion "27.0.0"
defaultConfig {
applicationId "com.packagename"
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/DEPENDENCIES'
pickFirst 'AndroidManifest.xml'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//implementation 'com.android.support:appcompat-v7:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
api 'com.android.support:design:26.1.0'
//){
// exclude group:'com.android.support' , module: 'support-annotations' version '26.1.0'
// exclude group:'com.android.support' , module: 'support-v4' version '26.1.0'
// exclude group:'com.android.support' , module: 'multidex' version '1.0.1'
// exclude group:'com.android.support' , module: 'cardview-v7' version '26.1.0'
//
// }
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:support-annotations:26.1.0'
//implementation 'com.google.android.gms:play-services-ads:11.6.0'
//implementation 'com.google.android.gms:play-services-auth:11.6.0'
api 'com.google.android.gms:play-services:11.6.0'
//implementation 'com.google.android.gms:play-services-gcm:11.6.0'
implementation "org.androidannotations:androidannotations-api:$AAVersion"
// implementation('com.github.afollestad.material-dialogs:core:0.8.5.7@aar') {
// transitive = true
// }
// implementation('com.github.afollestad.material-dialogs:commons:0.8.5.7@aar') {
// transitive = true
// }
implementation 'com.afollestad.material-dialogs:core:0.9.5.0'
implementation 'com.afollestad.material-dialogs:commons:0.9.5.0'
//api 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.daprlabs.aaron:cardstack:0.3.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.guava:guava:20.0'
implementation 'com.squareup.retrofit:retrofit:1.9.0'
implementation 'com.squareup.okhttp:okhttp:2.4.0'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.facebook.android:facebook-android-sdk:4.17.0'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.github.traex.rippleeffect:library:1.3'
implementation 'com.adobe.creativesdk.foundation:auth:0.9.1062'
implementation 'com.adobe.creativesdk:image:4.6.3'
implementation 'com.localytics.android:library:3.8.0'
// implementation 'com.github.fengdai:alertdialogpro-core:0.2.7-20161111.083903-7'
// implementation 'com.github.fengdai:alertdialogpro-theme-material:0.2.7-20161110.030043-6'
implementation 'com.eowise:recyclerview-stickyheaders:0.5.2@aar'
implementation 'com.mikepenz:iconics-core:2.5.2@aar'
implementation 'com.mikepenz:community-material-typeface:1.3.41.1@aar'
}
Root build.gradel
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha9'
// classpath 'me.tatarka:gradle-retrolambda:3.3.0-beta4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
/* 3) Add the Creative SDK Maven repo URL */
maven {
url 'https://repo.adobe.com/nexus/content/repositories/releases/'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Gradelwapper.property
#Mon Nov 13 11:59:09 IST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip
当它在2.3.3中完美运行但是当我在3.0上升级时它会出错 所以我在3.0中创建新的空白项目并移动所有java和资源文件 还包括所有lib但它显示此错误 将android studio 2.3.3中的代码合并到3.0 canary 提前致谢
答案 0 :(得分:0)
首先更新为Android Studio 3.0
然后在gradle-wrapper.properties
:
更改distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip
到distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
在您的 build.gradle 中尝试此操作(您必须更改applicationId
):
apply plugin: 'com.android.application'
repositories {
mavenLocal()
maven {
url 'http://maven.localytics.com/public'
}
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
android {
compileSdkVersion 26
// buildToolsVersion "27.0.0"
defaultConfig {
applicationId "com.custom.test"
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/DEPENDENCIES'
pickFirst 'AndroidManifest.xml'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
ext {
supportLibVersion = '26.1.0'
AAVersion = '3.3.2'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestImplementation 'com.android.support.test:runner:1.0.1'
testImplementation 'junit:junit:4.12'
implementation "com.android.support:design:$supportLibVersion"
implementation "com.android.support:support-v4:$supportLibVersion"
implementation 'com.android.support:multidex:1.0.1'
implementation "com.android.support:cardview-v7:$supportLibVersion"
implementation "com.android.support:support-annotations:$supportLibVersion"
api 'com.google.android.gms:play-services:11.6.0' // Avoid that. Import only what is needed
implementation "org.androidannotations:androidannotations-api:$AAVersion"
implementation 'com.afollestad.material-dialogs:core:0.9.5.0'
implementation 'com.afollestad.material-dialogs:commons:0.9.5.0'
implementation 'com.adobe.creativesdk.foundation:auth:0.9.1062'
implementation 'com.adobe.creativesdk:image:4.6.3'
implementation 'com.mikepenz:iconics-core:2.5.2@aar'
implementation 'com.mikepenz:community-material-typeface:1.3.41.1@aar'
implementation 'com.squareup.okhttp:okhttp:2.4.0'
implementation 'com.squareup.retrofit:retrofit:1.9.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.daprlabs.aaron:cardstack:0.3.0'
implementation 'com.eowise:recyclerview-stickyheaders:0.5.2@aar'
implementation 'com.facebook.android:facebook-android-sdk:4.17.0'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.github.traex.rippleeffect:library:1.3'
implementation 'com.google.guava:guava:20.0'
implementation 'com.localytics.android:library:3.8.0'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
}