Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Kotlinizeでハマった話

2,155 views

Published on

R.kt #2の発表資料です
https://recruit-lifestyle.connpass.com/event/71881/

Published in: Engineering
  • Be the first to comment

  • Be the first to like this

Kotlinizeでハマった話

  1. 1. Kotlinize R.kt #2
  2. 2. • Ippei Nawate • Android/ServerSide Engineer • Recruit Lifestyle • HOT PEPPER Beauty (HPB) • SNS: @sakuna63
  3. 3. HPB Kotlin • HPB 
 2016/12 2017/02 2017/12 Java Kotlinize 👏👏👏 : https://www.wantedly.com/projects/78442
  4. 4. Kotlin Java • Kotlin Java • 100% 
 Kotlinize
  5. 5. Kotlinize Annotation Processing (APT)
  6. 6. • Retrofit • REST • API 

  7. 7. Retrofit ... ...
  8. 8. Retrofit ... java.lang.IllegalArgumentException: Parameter type must not include a type variable or wildcard: java.util.Map<String, ? extends java.lang.Object> (parameter #1)
  9. 9. Retrofit ... java.lang.IllegalArgumentException: Parameter type must not include a type variable or wildcard: java.util.Map<String, ? extends java.lang.Object> (parameter #1) 🤔
  10. 10. Retrofit ... java.lang.IllegalArgumentException: Parameter type must not include a type variable or wildcard: java.util.Map<String, ? extends java.lang.Object> (parameter #1) 🤔 ...
  11. 11. • Kotlin read-only • open (<? extends Hoge>)
  12. 12. • Mutable • MutableList, MutableMap • Java • ArrayList, HashMap • @JvmSuppressWildcards
  13. 13. Annotation Processing(APT)
  14. 14. Kotlin APT • Kotlin APT 
 Kapt
  15. 15. Kapt • experimental • • • NonExistentClass
  16. 16. Kapt • experimental • • • NonExistentClass
  17. 17. NonExistentClass • Dagger • DI •
  18. 18. NonExistentClass Dagger ... (Module) ...
  19. 19. Dagger ... Factory ( ) NonExistentClass
  20. 20. NonExistentClass : NonExistentClass /Users/..../AppModule_AptGeneratedClassFactory.java:22: : public NonExistentClass get() { ^ Dagger ...
  21. 21. NonExistentClass : NonExistentClass /Users/..../AppModule_AptGeneratedClassFactory.java:22: : public NonExistentClass get() { ^ Dagger ... 🤔
  22. 22. NonExistentClass AptGeneratedClass NonExistentClass
  23. 23. NonExistentClass • Kapt NonExistentClass 
 • APT NonExistentClass 
 Kapt https://kotlinlang.org/docs/reference/kapt.html#non-existent-type-correction
  24. 24. NonExistentClass • Apt • 
 Kapt
  25. 25. NonExistentClass 2 • build.gradle `correctErrorTypes = true` • NonExistentClass • https://kotlinlang.org/docs/reference/kapt.html#non-existent-type- correction •

×