在更新playservice版本到12.0.0之后尝试构建应用程序时遇到问题但是它与版本11.8.0一起正常工作.它显示在应用程序中找不到绑定文件夹.
信息 :
Error:(20,38) error: package com.app.test.databinding does not exist
Error:(31,13) error: cannot find symbol class MainFragmentBinding
Gradle控制台日志
Exception is:org.gradle.API.tasks.TaskExecutionException: Execution Failed for task ':app:compileDevDeBUGJavaWithJavac'. at org.gradle.API.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100) at org.gradle.API.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70) at org.gradle.API.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63) at org.gradle.API.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54) at org.gradle.API.internal.tasks.execution.ValIDatingTaskExecuter.execute(ValIDatingTaskExecuter.java:58) at org.gradle.API.internal.tasks.execution.SkipEmptySourcefilesTaskExecuter.execute(SkipEmptySourcefilesTaskExecuter.java:88) at org.gradle.API.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52) at org.gradle.API.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) at org.gradle.API.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) at org.gradle.API.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.API.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.run(DefaultTaskGraphExecuter.java:248) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328) at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processtask(DefaultTaskPlanExecutor.java:124) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access0(DefaultTaskPlanExecutor.java:80) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.execute(DefaultTaskPlanExecutor.java:105) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.execute(DefaultTaskPlanExecutor.java:99) at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625) at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:60)
App Gradle
buildscript {repositorIEs { maven { url 'https://maven.fabric.io/public' }}dependencIEs { classpath 'io.fabric.tools:gradle:1.+'}}apply plugin: 'com.androID.application'apply plugin: 'io.fabric'apply plugin: 'realm-androID' repositorIEs {maven { url 'https://maven.fabric.io/public' } }ext {VERSION_BATCH_NOTIFICATION = '1.10.2'VERSION_PARCELER = '1.1.9'VERSION_RETROFIT = '2.3.0'VERSION_SUPPORT_liB = '27.1.0'VERSION_PLAYSERVICE = '12.0.0'VERSION_FIREBASE = '12.0.0'SDK_MINUMUM = 17SDK_TARGET = 27}androID {compileSdkVersion SDK_TARGET//keystore configurationsdefaultConfig { minSdkVersion SDK_MINUMUM targetSdkVersion SDK_TARGET testInstrumentationRunner "androID.support.test.runner.AndroIDJUnitRunner" multIDexEnabled true}buildTypes { release { MinifyEnabled false proguardfiles getDefaultProguardfile('proguard-androID.txt'),'proguard-rules.pro' }}flavorDimensions "environment"//app flavorsproductFlavors { dev { dimension "environment" applicationID "com.app.test" }}}//data binding enablesdataBinding { enabled = true}//enabled lamda ExpressionscompileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8}lintoptions { checkReleaseBuilds false // Or,if you prefer,you can continue to check for errors in release builds,// but continue the build even when errors are found: abortOnError false}testoptions { animationsDisabled = true}}dependencIEs {implementation filetree(include: ['*.jar'],dir: 'libs')//multIDex libimplementation 'com.androID.support:multIDex:1.0.3'//androID support libsimplementation "com.androID.support:appcompat-v7:${VERSION_SUPPORT_liB}"implementation "com.androID.support:support-v13:${VERSION_SUPPORT_liB}"implementation "com.androID.support:design:${VERSION_SUPPORT_liB}"implementation "com.androID.support:cardvIEw-v7:${VERSION_SUPPORT_liB}"implementation "com.androID.support:recyclervIEw-v7:${VERSION_SUPPORT_liB}"implementation "com.androID.support:support-v4:${VERSION_SUPPORT_liB}"//libs for vIEws and layoutimplementation 'com.androID.support.constraint:constraint-layout:1.0.2'implementation 'de.hdodenhof:circleimagevIEw:2.2.0'implementation 'com.romandanylyk:pageindicatorvIEw:1.0.0@aar'implementation 'com.daimajia.swipelayout:library:1.2.0@aar'//libs for API call and image loaderimplementation "com.squareup.retrofit2:retrofit:${VERSION_RETROFIT}"implementation "com.squareup.retrofit2:converter-gson:${VERSION_RETROFIT}"implementation "com.squareup.retrofit2:adapter-rxjava2:${VERSION_RETROFIT}"implementation 'com.github.bumptech.glIDe:glIDe:4.5.0'//Image picker and cropperimplementation 'com.github.esafirm.androID-image-picker:imagepicker:1.12.0'implementation 'com.github.esafirm.androID-image-picker:rximagepicker:1.12.0'implementation 'com.theartofdev.edmodo:androID-image-cropper:2.5.1',{ exclude group: 'com.androID.support',module: 'exifinterface'}//lib for batch notificationimplementation "com.batch.androID:batch-sdk:${VERSION_BATCH_NOTIFICATION}"//parceller libsimplementation "org.parceler:parceler-API:${VERSION_PARCELER}"annotationProcessor "org.parceler:parceler:${VERSION_PARCELER}"//gcmimplementation "com.Google.androID.gms:play-services-gcm:${VERSION_PLAYSERVICE}"//Firebase libsimplementation "com.Google.firebase:firebase-messaging:${VERSION_FIREBASE}"implementation "com.Google.firebase:firebase-core:${VERSION_FIREBASE}"implementation "com.Google.firebase:firebase-auth:${VERSION_FIREBASE}"implementation "com.Google.firebase:firebase-database:${VERSION_FIREBASE}"implementation 'com.firebase:geofire-androID:2.3.0'//lib for mapimplementation "com.Google.androID.gms:play-services-maps:${VERSION_PLAYSERVICE}"implementation "com.Google.androID.gms:play-services-location:${VERSION_PLAYSERVICE}"//rxjava-2 libsimplementation 'io.reactivex.rxjava2:rxjava:2.1.7'implementation 'io.reactivex.rxjava2:rxandroID:2.0.1'//language lib for managing emojiimplementation 'org.apache.commons:commons-text:1.2'//Testing libstestImplementation 'junit:junit:4.12'androIDTestImplementation 'com.androID.support.test:runner:1.0.1'androIDTestImplementation 'com.androID.support.test.espresso:espresso-core:3.0.1'implementation 'com.androID.support.test.espresso:espresso-IDling-resource:3.0.1'//Crashlytics libimplementation('com.crashlytics.sdk.androID:crashlytics:2.8.0@aar') { transitive = true;}}apply plugin: 'com.Google.gms.Google-services'
注意
当我将playservice和firebase版本降级到11.8.0时,我能够运行最佳答案我有同样的问题(只使用一些firebase的东西,而不是数据绑定).使用11.8.0但是当更新到12.0.0时它不再编译.
我意识到我有一个旧版本的play-services-auth后能够解决它.这必须与firebase版本匹配.
当这些依赖项来自不同的模块和库时,我正在使用resolutionStrategy(参见https://stackoverflow.com/a/42718231/2170109)来克服这个问题:
project.configurations.all { resolutionStrategy.eachDependency { details -> if (details.requested.group == 'com.Google.firebase' || details.requested.name.contains('play-services-auth')) { details.useVersion "$playServicesversion" } }}
总结 以上是内存溢出为你收集整理的android – 将PlayService版本更新为12.0.0后无法运行应用程序全部内容,希望文章能够帮你解决android – 将PlayService版本更新为12.0.0后无法运行应用程序所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)