2017-12-13 12 views
2
私は私のアプリをデバッグ

エラーがないが、私は署名したアプリを生成するとき、このエラーがある:これは、javaはエラー:(116)エラー:id型の予想されるリソース[ResourceTypeが]

/Users/dariobrun/Documents/AndroidStudioProjects/PGNChessEditor/app/src/main/java/it/dario/brun/pgnchesseditor/app/PannelloScacchiera.java:116: Error: Expected resource of type id [ResourceType] 
      black.setId(1); 
         ~ 

     Explanation for issues of type "ResourceType": 
     Ensures that resource id's passed to APIs are of the right type; for 
     example, calling Resources.getColor(R.string.name) is wrong. 

    1 errors, 0 warnings 

    FAILED 

    FAILURE: Build failed with an exception. 

    * What went wrong: 
    Execution failed for task ':app:lintVitalRelease'. 
    > Lint found fatal errors while assembling a release target. 

     To proceed, either fix the issues identified by lint, or modify your build script as follows: 
     ... 
     android { 
      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 
      } 
     } 
     ... 

    * Try: 
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 

    * Get more help at https://help.gradle.org 

    BUILD FAILED in 3s 

    25 actionable tasks: 3 executed, 22 up-to-date 

ですが、

black=new RadioButton(context); 
    black.setTextSize(TypedValue.COMPLEX_UNIT_PX,context.getResources().getDimension(R.dimen.pannello_size)); 
    black.setText(getResources().getString(R.string.moveblack)); 
    black.setId(1); 

でも、「ビルドに失敗しました」と表示されても、署名付きapkが生成されて正常に動作します。 どうしたの?私は心配する必要がありますか?

答えて

0

Lint found fatal errors while assembling a release target.

読む約lint

GradleのためのAndroidのプラグインは、あなたのモジュールレベルbuild.gradleファイルにlintOptions {}ブロックを使用して実行するか、無視するチェックかなど、特定のlintオプションを、設定することができます。そのCLEAN-REBUILD-RUN

lintOptions 
    { 
     abortOnError false 
     checkReleaseBuilds false 
    } 

+1

これは正常に動作します。ありがとうございます。 –

+0

@PierpaoloPierpaoli動作する場合は、この回答を受け入れる必要があります。答えの横の「TICK」マークをクリックしてください。 –

関連する問題