adfit / adfit-android-sdk

AdFit Android SDK for Publisher
Apache License 2.0
24 stars 13 forks source link

AdFit Context should be Activity! #13

Closed fancyydk closed 6 years ago

fancyydk commented 6 years ago

AdFit이 적용된곳은 Activity가 아니고 InputMethodService입니다.

3.0.3까지는 문제가 없었는데 3.0.4버전과 3.0.5버전에서는 런타임 익셉션이 발생하네요. AdFit Context should be Activity!

FATAL EXCEPTION: main Process: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class com.kakao.adfit.ads.ba.BannerAdView at android.view.LayoutInflater.inflate(LayoutInflater.java:539) at android.view.LayoutInflater.inflate(LayoutInflater.java:423) at android.view.LayoutInflater.inflate(LayoutInflater.java:374) at at android.inputmethodservice.InputMethodService.updateInputViewShown(InputMethodService.java:1117) at android.inputmethodservice.InputMethodService.showWindowInner(InputMethodService.java:1473) at android.inputmethodservice.InputMethodService.showWindow(InputMethodService.java:1447) at android.inputmethodservice.InputMethodService$InputMethodImpl.showSoftInput(InputMethodService.java:437) at android.inputmethodservice.IInputMethodWrapper.executeMessage(IInputMethodWrapper.java:203) at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:37) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class com.kakao.adfit.ads.ba.BannerAdView at android.view.LayoutInflater.createView(LayoutInflater.java:645) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) at android.view.LayoutInflater.inflate(LayoutInflater.java:515) at android.view.LayoutInflater.inflate(LayoutInflater.java:423)  at android.view.LayoutInflater.inflate(LayoutInflater.java:374)  at at android.inputmethodservice.InputMethodService.updateInputViewShown(InputMethodService.java:1117)  at android.inputmethodservice.InputMethodService.showWindowInner(InputMethodService.java:1473)  at android.inputmethodservice.InputMethodService.showWindow(InputMethodService.java:1447)  at android.inputmethodservice.InputMethodService$InputMethodImpl.showSoftInput(InputMethodService.java:437)  at android.inputmethodservice.IInputMethodWrapper.executeMessage(IInputMethodWrapper.java:203)  at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:37)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5417)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)  Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance(Native Method) at android.view.LayoutInflater.createView(LayoutInflater.java:619) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)  at android.view.LayoutInflater.inflate(LayoutInflater.java:515)  at android.view.LayoutInflater.inflate(LayoutInflater.java:423)  at android.view.LayoutInflater.inflate(LayoutInflater.java:374)  at at android.inputmethodservice.InputMethodService.updateInputViewShown(InputMethodService.java:1117)  at android.inputmethodservice.InputMethodService.showWindowInner(InputMethodService.java:1473)  at android.inputmethodservice.InputMethodService.showWindow(InputMethodService.java:1447)  at android.inputmethodservice.InputMethodService$InputMethodImpl.showSoftInput(InputMethodService.java:437)  at android.inputmethodservice.IInputMethodWrapper.executeMessage(IInputMethodWrapper.java:203)  at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:37)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5417)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)  Caused by: java.lang.IllegalStateException: AdFit Context should be Activity! at com.kakao.adfit.ads.ba.BannerAdView.(BannerAdView.java:279) at com.kakao.adfit.ads.ba.BannerAdView.(BannerAdView.java:263) at java.lang.reflect.Constructor.newInstance(Native Method)  at android.view.LayoutInflater.createView(LayoutInflater.java:619)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)  at android.view.LayoutInflater.inflate(LayoutInflater.java:515)  at android.view.LayoutInflater.inflate(LayoutInflater.java:423)  at android.view.LayoutInflater.inflate(LayoutInflater.java:374)  at at android.inputmethodservice.InputMethodService.updateInputViewShown(InputMethodService.java:1117)  at android.inputmethodservice.InputMethodService.showWindowInner(InputMethodService.java:1473)  at android.inputmethodservice.InputMethodService.showWindow(InputMethodService.java:1447)  at android.inputmethodservice.InputMethodService$InputMethodImpl.showSoftInput(InputMethodService.java:437)  at android.inputmethodservice.IInputMethodWrapper.executeMessage(IInputMethodWrapper.java:203)  at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:37)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5417)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 

chanyhan commented 6 years ago

@fancyydk

  1. 3.0.4 버전부터는 'Activty Context가 아닌 경우 광고 객체를 사용할 수 없습니다.
  2. Activity Context 이외 Context로 확장 할 계획은 당장 없습니다.
  3. 3.0.3을 계속 사용하신다면 앞서 문의한 이슈를 회피할 수는 있겠으나 정상적인 광고 집행에 관한 보장이 힘들며 장기적으로는 구버전에 관한 광고 송출 중단 등의 시점이 도래 시에는 이하 버전에 대한 광고집행이 중단 될 수도 있습니다.

이점 참고 부탁드립니다.