2017-08-08 101 views
0

我在android studio中創建了一個新項目,當這個終於在主活動中創建時標記了一些錯誤,其中一個錯誤是AppCpmátActivity,我知道這是因爲我不'沒有編譯出口,但我有它在我的Build.Gradle(模塊應用程序)導出。但是當我想要同步的gradle產出,這讓我的下一個錯誤在Android Studio中創建項目時出現的問題

those errors

這是我的build.gradle(模塊:APP)

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 26 
    buildToolsVersion "26.0.1" 
    defaultConfig { 
     applicationId "demontechsystemsecurity.trackingtool" 
     minSdkVersion 15 
     targetSdkVersion 26 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile 'com.android.support:appcompat-v7:26.+' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    testCompile 'junit:junit:4.12' 
} 

我不知道什麼是真正的問題,因爲我通過下載所有的SDK工具和

選擇,這是的build.gradle(項目簡介:項目名稱)

// Top-level build file where you can add configuration options common to all sub-projects/modules. 

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.3.3' 

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

allprojects { 
    repositories { 
     jcenter() 
    } 
} 

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

,如果我在倉庫google()添加它SHOWME這個

this error

,但如果我點擊了該Upgrade plugin to version 2.3.3 and sync project不作任何動作

+0

並且您是否嘗試像解決方案提示一樣安裝? –

+0

是的,但這並沒有做任何事情,我點擊安裝存儲庫和同步項目,但不做任何東西 –

+0

你可以顯示項目的build.gradle的內容。你的gradle版本將會在那裏。這將有助於解決問題 –

回答

0

添加Maven是相同{URL 「https://maven.google.com」}

allprojects { 
    repositories { 
     jcenter() 
     maven { 
      url "https://maven.google.com" 
     } 
    } 
}