Переадресация данных на xml не работает в Android Studio 3.1.2 - PullRequest
0 голосов
/ 26 апреля 2018

Я обновил android studio до последней версии (3.1.2), и теперь, когда я нажимаю на BindingClass с помощью ctrl, он не открывает для него XML-файл, который работал в предыдущей версии. И я попробовал то же самое с созданием нового проекта в той же версии андроид студии, но он работает над этим.

Так что я думаю, что я добавил некоторые неправильные зависимости или я сделал что-то не так. Поэтому, пожалуйста, направьте меня по этому вопросу.

Вот build.gradle

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'realm-android'
apply plugin: 'io.fabric'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId = "xxx.xxx.xxx"
        minSdkVersion 18
        targetSdkVersion 27
        versionCode 9
        versionName "1.0.8"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
//            signingConfig signingConfigs.config
            buildConfigField 'Boolean', 'enableCrashlytics', 'false'
        }
        debug {
            buildConfigField 'Boolean', 'enableCrashlytics', 'false'
        }
    }
    flavorDimensions "default"
    productFlavors {
        basic {
//            applicationIdSuffix ".basic"
//            versionName "0.1.9"
        }
        admin {
//            applicationIdSuffix ".admin"
//            versionName "0.1.9-admin"
        }
    }
    dataBinding {
        enabled = true
    }
    packagingOptions {
        exclude 'META-INF/maven/com.squareup.okhttp3/okhttp/pom.properties'
        exclude 'META-INF/maven/com.squareup.okhttp3/okhttp/pom.xml'
        exclude 'META-INF/maven/com.squareup.okio/okio/pom.properties'
        exclude 'META-INF/maven/com.squareup.okio/okio/pom.xml'
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation(name: 'wikitudesdk', ext: 'aar')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation 'com.android.support:appcompat-v7:27.1.0'
    implementation 'com.android.support:design:27.1.0'
    implementation 'com.google.android.gms:play-services-maps:11.6.0'
    implementation 'com.google.android.gms:play-services-location:11.6.0'
    implementation 'com.google.android.gms:play-services-analytics:11.6.0'
    testImplementation 'junit:junit:4.12'
    implementation 'com.squareup.okhttp3:okhttp:3.5.0'
    implementation('com.squareup.retrofit2:retrofit:2.1.0') {
        exclude module: 'okhttp'
    }
    implementation('com.squareup.retrofit2:adapter-rxjava:2.1.0') {
        exclude module: 'okhttp'
    }
    implementation('com.squareup.retrofit2:converter-gson:2.1.0') {
        exclude module: 'okhttp'
    }
    implementation('com.squareup.okhttp3:logging-interceptor:3.5.0') {
        exclude module: 'okhttp'
    }
    implementation 'com.google.dagger:dagger:2.8'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.8'
    implementation 'io.reactivex:rxandroid:1.2.1'
    implementation 'io.reactivex:rxjava:1.1.6'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.google.android:flexbox:0.3.0-alpha2'
    annotationProcessor 'org.parceler:parceler:1.1.6'
    implementation 'org.parceler:parceler-api:1.1.6'
    implementation 'com.google.guava:guava:20.0'
    implementation 'me.zhanghai.android.materialprogressbar:library:1.3.0'
    implementation 'com.facebook.fresco:fresco:1.1.0'
    implementation 'com.facebook.fresco:animated-gif:1.1.0'
    implementation 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'com.caverock:androidsvg:1.2.1'
    implementation 'joda-time:joda-time:2.9.3'
    implementation 'com.google.code.gson:gson:2.8.0'
    implementation 'io.realm:android-adapters:1.3.0'
    implementation 'com.mobsandgeeks:android-saripaar:2.0.2'
    implementation 'org.greenrobot:eventbus:3.0.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.jakewharton.timber:timber:4.5.1'
    implementation('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
        transitive = true
    }
    implementation 'com.github.JakeWharton:ViewPagerIndicator:2.4.1'
    implementation 'com.google.android.exoplayer:exoplayer:r2.2.0'
    implementation 'com.github.faruktoptas:FancyShowCaseView:0.1.0'
    implementation 'com.google.firebase:firebase-messaging:11.6.0'
    implementation 'com.facebook.android:facebook-android-sdk:4.28.0'

    implementation 'com.shawnlin:number-picker:2.4.4'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.google.maps.android:android-maps-utils:0.5'
    implementation 'com.intuit.sdp:sdp-android:1.0.4'
    implementation 'com.google.firebase:firebase-perf:11.6.0'
    implementation 'com.facebook.stetho:stetho:1.5.0'
    implementation 'com.uphyca:stetho_realm:2.1.0'
    //    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'

    //    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'

    //    testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
}

repositories {
    flatDir {
        dirs 'libs'
    }
    maven { url 'https://maven.fabric.io/public' }
}

apply plugin: 'com.google.gms.google-services'

Вот уровень проекта build.gradle

buildscript {
    repositories {
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath "io.realm:realm-gradle-plugin:3.0.0"
        classpath 'io.fabric.tools:gradle:1.+'
        classpath 'com.google.gms:google-services:3.1.1'
        classpath 'me.tatarka:gradle-retrolambda:3.6.1'
        classpath 'com.google.firebase:firebase-plugins:1.1.4'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven {url "https://jitpack.io"}
        maven {url 'https://github.com/uPhyca/stetho-realm/raw/master/maven-repo'}
        google()
    }
}

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

Большое спасибо.

Ответы [ 2 ]

0 голосов
/ 30 октября 2018

Для открытия связанных XML

В Android Studio появился новый значок для соответствующего перенаправления XML. Моя версия AS - 3.2.1.

sc3

Хак для открытия Binding Class.

  • Ctrl + N (Открыть файл)
  • Введите ActivityMainBinding {или первые буквы - Amb for ActivityMainBinding, если вы достаточно умны:)
  • Нажмите Enter на ActivityMainBinding

sc1

sc2

Кстати, я столкнулся с этой проблемой только в классе Java, [Перейти к объявлению] хорошо работает с kotlin.

0 голосов
/ 26 апреля 2018

добавить приведенный ниже код в файл gradle уровня проекта.

jcenter()

ниже файла gradle в проекте все работает нормально.

buildscript {

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


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

}

  allprojects {
 repositories {
    google()
    jcenter()
 }

}

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

}

...