DataBinding Android Studio 2.3 versiyasini yangilashdan so'ng ishlamayapti

DataBinding mening loyihamda juda yaxshi ishladi, ammo Android Studio 2-ni bugungi kunda yangilashdan so'ng. Ishni bajarish muvaffaqiyatsiz tugadi, chunki quyidagi xato:

Error:(15, 40) Error: package com.javan.myrecorder.databinding not exist.
import com.javan.myrecorder.databinding.FragmentEventsBinding;
:app:compileMockDebugJavaWithJavac FAILED

Faqat Android studiyasini yangilayman va hech narsa o'zgarmaydi. barcha plagin eng oxirgi! Endi mening savolim nima uchun bu xatolik yuz beradi va uni qanday hal qilishim mumkin? har qanday yordam yoq!

Ingliz tili mening ona tilim emas; Iltimos, mening xatolarimni kechiring.


EDIT1

Like android project googlesamples/android-architecture

  • git checkout todo-databinding
  • and then run ./gradlew assembleDebug to build, build failed because of following error:

Qurilishning to'liq jurnali


EDIT2 Ushbu muammoni Ma'lumotlarni ulash Gradle 2.3 ga yangilangandan so'ng sinadi . .

build.gradle (app) ilovasida qo'shing

apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'

..balabala

dependencies {
    apt 'com.android.databinding:compiler:2.3.0'
}

loyihamdagi ba'zi fayllar:

gradle-wrapper.properties

#Mon Mar 06 10:59:04 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

@pretrnohejl @ Zorge Sa-Zad Prasla tog 'tizmasi, rahmat!

17
Android.databinding.PropertyChangeRegistry bilan o'xshash muammo bor. Menga import bayonotida xatolik sabab bo'lib, loyihani kompilyatsiya qila olmayman. Build Tools 2.2.3 ga qaytib kelganimda, u ishlaydi. O'ylaymanki, 2.3-da ma'lumotlar ulanishi noto'g'ri.
qo'shib qo'ydi muallif petrnohejl, manba
Boshqa xatolarni ko'rdingizmi?
qo'shib qo'ydi muallif George Mount, manba
Bundan tashqari, konfiguratsiyangizda boshqacha narsa bormi, masalan, apt?
qo'shib qo'ydi muallif George Mount, manba
@GeorgeMount Xristian: Keyin yana bir xato jurnalni joylashtiraman, javobingiz uchun rahmat, rahmat
qo'shib qo'ydi muallif Javan Zhu, manba
@George Tog'i, men bir necha xato jurnalini qo'shdim; O'ylashimcha, grader yoki ma'lumotni ulashda noto'g'ri narsa bor, chunki Googlega tegishli bo'lgan [googlesamples/android-architecture] (googlesamples/android-architecture) (https://github # com/googlesamples/android-architecture) filialining todo-databind quyida ko'rsatilgan.
qo'shib qo'ydi muallif Javan Zhu, manba

7 javoblar

android-apt and hence using apt has been deprecated since Android Studio 2.2.
Following the android-apt migration guide, instead add the following to your build.gradle:

dependencies {
    classpath 'com.android.tools.build:gradle:2.3.0'//use same gradle version!
    annotationProcessor 'com.android.databinding:compiler:2.3.0'
}

Agar siz Kolin dan foydalanayotgan bo'lsangiz, quyidagilarni foydalaning:

apply plugin: 'kotlin-kapt'

dependencies {
    classpath 'com.android.tools.build:gradle:2.3.0'//use same gradle version!
    kapt 'com.android.databinding:compiler:2.3.0'
}
14
qo'shib qo'ydi
ishlamayapti, xato hali davom etmoqda. nima uchun?
qo'shib qo'ydi muallif Kadir altınok, manba
Men bu o'zgarishlarga qo'shimcha ravishda men ham ishladim, men ham gradusli versiyani 2,3,0 ga bog'liqligini o'zgartirdim {classpath "com.android.tools.build:gradle:2.3.0"}
qo'shib qo'ydi muallif Tushar, manba
@Tushar rahmat, javobni yangiladim, shu bilan bir xil gradusli versiyani ishlatmoqdasiz
qo'shib qo'ydi muallif Josh Bowden, manba

Muammo barcha xatolar orasida ko'rish qiyin bo'lgan ogohlantirishga ega:

Ogohlantirish: izohga ishlov berish uchun mos kelmaydigan plaginlardan foydalanish: android-apt. Bu kutilmagan xatti-harakatga olib kelishi mumkin.

Aptni olib tashlasangiz, ma'lumotlar ulash ishlari bajariladi.

2
qo'shib qo'ydi
build.gradle uchun apt 'com.android.databinding: derleyici: 2.3.0' qo'shing. va hozir hamma narsa yaxshi, tezkor ishlaydi. Xatoga sabab bo'lgan ma'lumotlar ulash kompilyatorining versiyasi bo'lishi kerakmi?
qo'shib qo'ydi muallif Javan Zhu, manba

Men ham xuddi shu masalaga duch keldim. ButterKnife va Daggerdan foydalanardim!

Quyidagidek hal qilindi

1) App darajasi darajasidagi fayldan olib tashlash:

plaginni qo'llash: 'android-apt'  yoki plaginni qo'llash: 'com.neenbedankt.android-apt'

2) Project level gradle faylidan olib tashlash:

classpath 'com.neenbedankt.gradle.plugins: android-apt: 1,8'

3) va faqat "annotationProcessorchange" ga quyidagi bog'liqliklarni o'zgartiring:

apt 'com.jakewharton: butterknife-compiler: 8.5.1',   apt "com.google.dagger: dagger-derleyici: 2,5"

Kimga:

annotationProcessor 'com.jakewharton: butterknife-compiler: 8.5.1',  annotationProcessor "com.google.dagger: dagger-derleyici: 2,5"

2
qo'shib qo'ydi

Android-Studio v2.3-ga yangilashdan keyin ma'lumotlarni uzatish biz uchun ham buzildi. GoLang Binding plaginini kutubxona .aar fayllarini yaratib bo'lmadi

Bizning muammomiz GoMobile versiyasi "+ eb90329 7-mart 2017" yangilanishi va GoBind plaginini "0.2.6" versiyasiga qaytishi bilan hal qilindi (hozirgi versiya "0.2.8" bo'lsa-da)

GoMobile-ni yangilash:

  $ go get -u -x golang.org/x/mobile/cmd/gomobile
  $ gomobile init -x

BuildGradle'da GoBind plaginini qayta tiklash:

  plugins {
    id "org.golang.mobile.bind" version "0.2.6"
  }

Ushbu hal 1.7.1 va 1.8 versiyalari bilan ishlaydigan tizimlarda, shuningdek, Android Studio versiyalari 2.1.2, 2.2.3 va 2.3 da ishlaydi.

1
qo'shib qo'ydi

Men bu masalani graderning versiyasini o'zgartirib, hal qildim:

classpath 'com.android.tools.build:gradle:3.0.1'

Android Studio 3.0.1 dan foydalanganimdan beri

1
qo'shib qo'ydi

I too recently downloaded the latest version of android studio 2.3.3, because I was getting the same error in version 2.2.3 i.e Error:Failed to resolve: com.android.databinding:compiler:2.2.3 ,even in the latest version, I was getting the same error,I checked the project structure, In the File>Project Structure>Project , the Android Plugin version was still 2.2.3, I changed it to 2.3.3 and the build is successful and everything is working smoothly.

0
qo'shib qo'ydi

Ikki narsa Gradel-wrapper.properties tarqatish xizmatini "https://services.gradle.org/distributions/gradle-2.14.1-all.zip" manziliga qaytaring. Grader versiyasi klassini oldingi versiyaga o'zgartiring "'com.android.tools.build:gradle:2.2.3'"

P.S. Instant run ADT da eski gradusli versiyasi bilan ishlashni to'xtatadi.

0
qo'shib qo'ydi
Salom @ Sa-Zad Prasla, Qaytib kelinglar, mening grader versiyam ish, lekin eng yaxshi yechim emas, javobingiz uchun rahmat.
qo'shib qo'ydi muallif Javan Zhu, manba