Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Android Studio の気になる warnings を抑制する方法まとめ

Android Studio の気になる warnings を抑制する方法まとめ

Gotanda.mobile #2 in VASILY で発表した資料です。
https://gotandamb.connpass.com/event/50876/

Pine Mizune

March 23, 2017
Tweet

More Decks by Pine Mizune

Other Decks in Programming

Transcript

  1. 1JOF .J[VOF  .BS   (PUBOEBNPCJMF  JO 7"4*-:

    "OESPJE 4UVEJP ͷؾʹͳΔ XBSOJOHT Λ ཈੍͢Δํ๏·ͱΊ
  2. ࣗݾ঺հ v (JU)VC !QJOF v 5XJUUFS !QJOF v גࣜձࣾωΫετϏʔτ JO

    ޒ൓ా v (PUBOEBNPCJMFKT 0SHBOJ[FS v ֆจࣈδΣωϨʔλʔ "VUIPS
  3. ֓ཁ "OESPJE ͷ։ൃͰΑ͋͘Δ XBSOJOHT ͱ ͦͷ XBSOJOHT Λ ཈੍͢Δํ๏ Λ·ͱΊ·ͨ͠ɻ

    ແବʹπʔϧʹౖΒΕͳ͍ շదͳ։ൃ؀ڥ Λ࡞Γ·͠ΐ͏ɻ
  4. ͳͥ XBSOJOHT Λ཈੍͢Δͷ͔  ରԠ͠ͳͯ͘΋ྑ͍ XBSOJOHT Ͱ͋ΔͨΊ o ࢦఠࣗମ͕ؒҧ͍ͬͯΔ ޡݕ஌

    o ϓϩμΫτతʹରԠͷඞཁੑ͕ബ͍  BCPSU0O&SSPS Λઃఆ͢Δํ਑ͳ৔߹ o XBSOJOHT ΛରԠ͢Δ͔ɺແࢹͤ͞Δ͔ͷೋ୒  ؾʹͳΔ͔Β ˡରԠ͢Δͱਫ਼ਆӴੜ্ྑ͍
  5. XBSOJOHT Λ཈੍͢Δʹ͸  ϑΝΠϧ୯ҐͰແࢹͤ͞Δ o XBSOJOHT ֘౰Օॴʹແࢹͤ͞Δهड़Λߦ͏ o ίʔυࣗମ͕৑௕ʹͳΔͷ͕σϝϦοτ 

    ϓϩδΣΫτ୯ҐͰແࢹͤ͞Δ o ϓϩδΣΫτશମͷઃఆ ྫ CVJMEHSBEMF ʹهड़ o XBSOJOHT ࣗମʹؾ͚ͮͳ͘ͳΔͷ͕σϝϦοτ
  6. ϑΝΠϧ୯ҐͰͷ XBSOJOHT ରԠ ଟ͘ͷ৔߹ϛεͳͷͰܯࠂͯ͠ཉ͍͕͠ɺ ಛఆͷՕॴͰ͸཈੍͍ͨ͠ XBSOJOHT q༻్ OFWFS VTFE EFQSFDBUFE

    DPOUFOU%FTDSJQUJPO
  7. ϑΝΠϧ୯Ґ +BWB  ,PUMJO ϑΝΠϧ OFWFS VTFE EFQSFDBUFE ద੾ͳΞϊςʔγϣϯΛ෇͚·͠ΐ͏ q݁࿦

    @SuppressWarnings("unused") @SuppressWarnings("deprecation") ࢀߟ IUUQLVSSZUSBOCMPHTQPUKQBOESPJETUVEJPMJTUPGTVQQSFTTXBSOJOHIUNM
  8. ϑΝΠϧ୯Ґ ϨΠΞ΢τ 9.- ϑΝΠϧ DPOUFOU%FTDSJQUJPO q݁࿦ UPPMJHOPSF Λ࢖͍·͠ΐ͏ xmlns:tools="http://schemas.android.com/tools" tools:ignore=”ContentDescription”

  9. ϑΝΠϧ୯Ґ ϨΠΞ΢τ 9.- ϑΝΠϧ q݁࿦ UPPMJHOPSF Λ࢖͍·͠ΐ͏ xmlns:tools="http://schemas.android.com/tools" tools:ignore="RtlHardcoded” 3JHIU

    UP -FGU TVQQPSUT
  10. ϓϩδΣΫτ୯ҐͰͷ XBSOJOHT ରԠ ϓϩδΣΫτͷ໨తୡ੒ͷͨΊʹ ͦ΋ͦ΋ෆཁͳ XBSOJOHT ͳ৔߹ q༻్ DPOUFOU%FTDSJQUJPO 3JHIU

    UP -FGU TVQQPSUT
  11. ϓϩδΣΫτ୯Ґ XBSOJOHT ࣗମΛແޮԽ͢Δ "OESPJE -JOU ͷઃఆͰແޮԽ͠·͠ΐ͏ q݁࿦ 3JHIU UP -FGU

    TVQQPSUT ͦ΋ͦ΋೔ຊͰ͔͠ϦϦʔε͠ͳ͍ʜ lintOptions { disable 'RtlHardcoded' } JO CVJMEHSBEMF ࢀߟ IUUQLVSSZUSBOCMPHTQPUKQBOESPJETUVEJPMJTUPGTVQQSFTTXBSOJOHIUNM
  12. ϓϩδΣΫτ୯Ґ XBSOJOHT ݕग़ͷݪҼΛઈͭ XBSOJOHT ݕग़࣌ͷઃఆͰ཈੍Ͱ͖Δ৔߹͕͋Δ q݁࿦ VOVTFE Ξϊςʔγϣϯܦ༝Ͱݺͼग़͞ΕΔʜ <component name="EntryPointsManager">

    <entry_points version="2.0" /> <list size="1"> <item index="0” class="java.lang.String” itemvalue="butterknife.OnClick" /> </list> </component> JO JEFBNJTDYNM
  13. ·ͱΊ v ରԠෆཁͳ XBSOJOHT ͸཈੍Մೳ v ϑΝΠϧ͝ͱɺϓϩδΣΫτ͝ͱʹઃఆՄೳ v ରԠ͢΂͖΋ͷ͸ɺ཈੍ͤͣରԠ͠·͠ΐ͏