Com.android.builder.model.AndroidProject interfeysi uchun sinf yo'lini aniqlab bo'lmadi

Android Studio'ga Eclipse loyihasini olib kelganimda, men bu masalani oldim: Gradle 'XNote' loyihasi yangilandi     Xato: com.android.builder.model.AndroidProject interfeysi uchun sinf yo'lini aniqlab bo'lmadi. Nima uchun bunday bo'ldi? Rahmat!

enter image description here enter image description here

51
Men siz bilan bir xil muammolarga egamanki, Android Studio-ni 2.2.3 dan 2.3 gacha yangilab bo'lgandan so'ng
qo'shib qo'ydi muallif Morten Holmgaard, manba

8 javoblar

Hozir men bir xil muammolarga duch kelmoqdaman.

1. Build.gradle faylida klass usulini tekshiring. o'zgartirish

classpath "com.android.tools.build:gradle:2.3.0"

  1. then gradu-wrapper.properties sahifasiga o'ting va distribyutorni o'zgartiring

distributionUrl = http: //services.gradle.org/distributions/gradle-3.3-all.zip

keyin loyihani qayta qurish kerak. men uchun yordam ... Menimcha, bu sizga albatta yordam beradi.

153
qo'shib qo'ydi
Yopishqoqlikda, "distributionUrl = https: //services.gradle.org/distributions/‌ gradle-3.3-all.zip" bo'lishi kerak.
qo'shib qo'ydi muallif Kyaw Min Thu L, manba

Men bu muammoni hal qildim.

Google doesn't update ADT any more, so when Eclipse export a project to gradle, it use an old gradle plugin version that Android Studio doesn't support. enter image description here

First, you should check the version of gradle plugin that you have installed. Open Android Studio's installation directory,then open the directory \gradle\m2repository\com\android\tools\build\gradle\, you will see all version you have installed. enter image description here

Then open Android Studio, open tab 'Project -> Gradle Scripts', Edit file build.gradle, change the gradle plugin to newest version you have installed, such as 2.3.0: enter image description here

[Majburiy] Ushbu qadam shart emas, lekin buni qilmasangiz, bu muammoni ko'rishingiz mumkin:

A problem occurred evaluating root project 'XXX'.
> org/gradle/initialization/BuildCompletionListener

Check the newest version of gradle you have installed at C:\Users\YOUR USER NAME\.gradle\wrapper\dists. enter image description here Then open tab 'Project -> Gradle Scripts', edit file gradle-wrapper.properties, modify the gradle version(attention: gradle, NOT gradle plugin) to the newest at the last line. enter image description here

Finally, click Build - Clean Project, done! If it still warning "Gradle project sync failed...", just click Try Again! enter image description here

TUG'ILGAN, SABABLAR MENGA JAVOB BERADI YoRDAM BERADI, Grammatik xatolarsiz !!!

34
qo'shib qo'ydi
Men ushbu javobni ovoz berdim, chunki u ikkita faylni kiritish uchun versiya raqamlarini qanday topish kerakligini yozdi
qo'shib qo'ydi muallif Antonino, manba
Men buni sinab ko'rdim, ammo xato davom etmoqda
qo'shib qo'ydi muallif Tiger developer, manba

Faqat ikki narsani yangilang: -

1) Build.gradle kodini yangilang

dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
}

2) Update Gradle-wrapper.properties: (Change Android mode > Project mode then Extend Gradle and open Gradle-wrapper.properties)

distributionUrl = http: //services.gradle.org/distributions/gradle-1.12-all.zip manzilini o'zgartiring. By

distributionUrl=http://services.gradle.org/distributions/gradle-3.3-all.zip

Bu har doim bu masalani hal qiladi. Siz uchun u foydalidir

6
qo'shib qo'ydi

Build.gradle versiya 25.0.0 versiyasiga qurilgan vositalarni yangilashdan so'ng uni ishga tushirdim:

buildToolsVersion '25.0.0'

And change project to use newest gradle version 3.3 with default gradle wrapper (File -> Settings -> Gradle)

3
qo'shib qo'ydi
Bu ham xuddi o'sha. Lekin oldin 19, 20 va 25 ni o'rnatishim kerak edi. Nima uchun bilmayman, lekin hozir ishlayapti. Menimcha, Android SDK 19-versiyasiga asoslangan bo'lishi mumkin bo'lgan kompilyatsiya qilmoqchi bo'lgan maxsus boshqaruvlarmi? Faqat taxmin qiling.
qo'shib qo'ydi muallif MikeyE, manba

Menimcha, papkani o'chirib tashladim .deyani loyihadan olib tashladim, keyin esa studiyani qayta ishga tushirish barcha zarur papkalarni va gradusli ishlarni avtomatik ravishda boshqaradi.

1
qo'shib qo'ydi

Ushbu muammoni hal qilishning eng yaxshi usuli build.gradle va gradle-wrapper.properties qiymatlarini ishlaydigan loyihadan maqsadli loyihaga ko'chirish/ko'chirishdir!

Baxtli kodlash !!

1
qo'shib qo'ydi

Birinchidan, uy katalogida .gradle papkasini o'chirib tashlang, keyin Android Studio dasturini qayta ishga tushiring.

1
qo'shib qo'ydi

Palanivelragul to'g'ri edi. Studio oldingi versiyani yuklab olish kerak. Keyin u 3 ta variantni taqdim etdi.

Yuqori variantni ~ "3.0.1 bilan sinxronlashtirishni tanlash ni tanlang.

Voqealar jurnali:

Gradle sync started > Project setup started > Gradle sync finished > Executing tasks:

[:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar] > Gradle build finished.
1
qo'shib qo'ydi