1

我的朋友給了我一個在Windows平臺上構建的項目,我有Ubuntu。所以當我導入項目時,我得到這個錯誤,Android Studio:不受支持的major.minor版本52.0

Error:(1, 0) Cause: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0 

如何讓我的項目運行。我嘗試了所有可能的解決方案,但沒有任何一個可行。

我已經指出了我的SDK路徑並使用了JDK 1.7.0。使用最新的Gradle 2.14.1。

這是我的gradle.build文件。

apply plugin: 'com.android.application' 

    android { 
     compileSdkVersion 23 
     buildToolsVersion "23.0.1" 
     useLibrary 'org.apache.http.legacy' 

     defaultConfig { 
      applicationId "com.example.lenovo.myapp" 
      minSdkVersion 19 
      targetSdkVersion 23 
      versionCode 1 
      versionName "1.0" 
      multiDexEnabled true 
     } 
     buildTypes { 
      release { 
       minifyEnabled false 
       proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
      } 
     } 
     packagingOptions { 
      exclude 'META-INF/DEPENDENCIES' 
      exclude 'META-INF/NOTICE' 
      exclude 'META-INF/LICENSE' 
      exclude 'META-INF/LICENSE.txt' 
      exclude 'META-INF/NOTICE.txt' 
     } 
    } 

    dependencies { 
     compile fileTree(dir: 'libs', include: ['*.jar']) 
     compile 'com.google.api-client:google-' + 
       'api-client-gson:+' 
     compile 'com.android.support:appcompat-v7:23.4.0' 
     compile 'com.android.support:design:23.4.0' 
     compile 'com.google.http-client:google-http-client-android:+' 
     compile 'com.google.api-client:google-api-client-android:+' 
     compile 'com.google.code.gson:gson:2.2.4' 
     compile 'org.apache.httpcomponents:httpclient:4.5' 
     compile 'com.google.android.gms:play-services-identity:9.2.1' 
     compile 'com.google.android.gms:play-services-plus:9.2.1' 
     compile 'com.google.android.gms:play-services-gcm:9.2.1' 
     compile 'com.mcxiaoke.volley:library-aar:1.0.0' 
     compile 'org.apache.httpcomponents:httpcore:4.4.1' 
     compile 'org.apache.httpcomponents:httpmime:4.3.6' 
     compile 'com.squareup.retrofit2:retrofit:2.1.0' 
     compile 'com.squareup.okhttp:okhttp:2.3.0' 
     compile 'com.squareup.retrofit2:converter-gson:2.1.0' 
     compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha5' 
     compile 'com.github.bumptech.glide:glide:3.6.0' 
     compile 'com.jakewharton:butterknife:6.1.0' 
     compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.1.3' 
     testCompile 'junit:junit:4.12' 
    } 

任何解決方案,將不勝感激。我從最近2天起就陷入困境。

回答

3

我已經指向我的SDK路徑和使用JDK 1.7.0

你需要JDK 1.8與工作室和新版本的編譯工具。

+0

我將JDK路徑更改爲8 - Oracle,現在出現此錯誤「安裝存儲庫和同步項目」。任何想法? – SSR

+0

無法解決:com.android.support.constraint:constraint-layout:1.0.0-alpha5 – SSR

+0

以上是完整錯誤 – SSR

相關問題