2016-12-07 3 views
0

Ich habe gerade Android Studio installiert und aktualisiert die SDK. Ich habe ein neues Projekt erstellt, aber es scheint nicht zu kompilieren. Es gibt ein Problem mit gradle sync:Android Studio Startproblem auf Windows

Error:(29, 0) Could not find method android() for arguments [[email protected]] on root project 'MyApplication' of type org.gradle.api.Project.

Das ist mein Manifest-Datei:

<?xml version="1.0" encoding="utf-8"?> 

<application 
    android:allowBackup="true" 
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/app_name" 
    android:supportsRtl="true" 
    android:theme="@style/AppTheme" > 
    <activity android:name=".MainActivity" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
</application> 

Einige unnütze Worte, weil zu viel Code

Dies ist die build.gradle Datei:

buildscript { 
    repositories { 
     jcenter() 
     } 
     dependencies { 
      classpath 'com.android.tools.build:gradle:2.2.3' 
     } 
    } 
    allprojects { 
     repositories { 
      jcenter() 
     } 
    } 
    task clean(type: Delete) { 
     delete rootProject.buildDir 
    } 
    subprojects { 
     ext { 
      compileSdkVersion = 22 
      buildToolsVersion = '25.0.1' 
     } 
    } 
    android{ 
     compileSdkVersion 22 
     buildToolsVersion '25.0.1' 
     dexOptions { 
      incremental true 
     } 
     compileOptions { 
      sourceCompatibility JavaVersion.VERSION_1_6 
      targetCompatibility JavaVersion.VERSION_1_6 
     } 
    } 
    dependencies { 
     compile files('app/libs/junit-4.12-JavaDoc.jar') 
    } 
+0

Bitte fügen Sie Ihre build.gradle Dateiinhalt. –

Antwort

0

Wie ich verstehe Sie über ein gradle Build Problem sprechen. Wenn ich es richtig verstehe, gibt es eine einfache Lösung.

  1. öffnen gradle.build
  2. Suche android {
  3. Paste in diesem Code darunter:

    android { compileSdkVersion 24 buildToolsVersion "23.0.3"

  4. :

    compileSdkVersion 24 buildToolsVersion "23.0.3

    Es ist wie dieses dann aussehen sollte

+0

Wenn ich falsch liege, denke ich viel Glück jemanden zu finden, der besser als ich weiß. – DzefersonS

0

apply plugin: 'com.android.application'

android { compileSdkVersion 25 buildToolsVersion "25.0.0" defaultConfig { applicationId "com.example.myapplication" minSdkVersion 16 targetSdkVersion 25 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:25.0.1' testCompile 'junit:junit:4.12' }