2017-10-09 80 views
0

我試圖在移動設備上運行應用程序ono發佈模式。上運行我的消息日誌的點擊充滿了這些錯誤後:構建應用程序發佈的數據綁定問題

Warning:android.databinding.DataBindingUtil: can't find referenced class android.databinding.DataBinderMapper 
Warning:android.databinding.DataBindingUtil: can't find referenced class android.databinding.DataBindingComponent 
Warning:android.databinding.ViewDataBinding: can't find referenced class android.databinding.DataBinderMapper 
Warning:android.databinding.ViewDataBinding: can't find referenced class android.databinding.DataBindingComponent 
Warning:android.databinding.ViewDataBinding: can't find referenced class android.databinding.DataBinderMapper 
Warning:android.databinding.ViewDataBinding: can't find referenced class android.databinding.DataBindingComponent 
Warning:okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 
Warning:okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 
Warning:there were 46 unresolved references to classes or interfaces. 
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first. 
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForStageRelease'. 
> Job failed, see logs for details 

這是我的build.gradle

buildTypes { 
     release { 
      debuggable false 
      minifyEnabled true 
      zipAlignEnabled true 
      shrinkResources true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
      signingConfig signingConfigs.bom 
      pseudoLocalesEnabled false 
     } 
     debug { 
      debuggable true 
     } 
    } 

在釋放部分的誤差降至約3

插入 dataBinding{enabled true }的某些部分
Information:Gradle tasks [:app:assembleStageRelease] 
Warning:okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 
Warning:okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 
Warning:there were 3 unresolved references to classes or interfaces. 
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first. 
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForStageRelease'. 
> Job failed, see logs for details 

這是有原因嗎?

回答

2

由於來自ProGuard的警告,您的構建失敗。這些並不總是阻塞,你可以添加-dontwarn行到Proguard來解決它們。最好的辦法是查找受影響代碼所在的庫,並從庫中查找ProGuard規則可以安全添加的文檔。