Dagger и libgdx - PullRequest
       21

Dagger и libgdx

0 голосов
/ 05 января 2019

Можно ли использовать dagger 2 и libgdx web? Проект libgdx прекрасно работает с Android и рабочим столом. Когда я добавляю веб-модуль и запускаю с

./gradlew html:superDev

[ERROR] Line 1: The type javax.inject.Named cannot be resolved. It is indirectly referenced from required .class files
      [ERROR] Line 30: The import dagger.Lazy cannot be resolved
      [ERROR] Line 32: The import javax.inject.Inject cannot be resolved
      [ERROR] Line 37: Inject cannot be resolved to a type

После этого http://www.g -widgets.com / 2017/06/28 / dependency-инъекция в gwt-using-dagger-2 . У меня в моем Game.gwt.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "http://www.gwtproject.org/doctype/2.8.0/gwt-module.dtd">
<module>
    <inherits name="dagger.Dagger" />
    <source path="com/trashmelody" />
</module>

Это выдаст другую ошибку

 [ERROR] Line 34: No source code is available for type com.trashmelody.di.ComponentProvider<T>; did you forget to inherit a required module?
      [ERROR] Line 34: No source code is available for type com.trashmelody.di.AppComponent; did you forget to inherit a required module?
      [ERROR] Line 47: No source code is available for type com.trashmelody.managers.ScreenProvider; did you forget to inherit a required module?
      [ERROR] Line 177: No source code is available for type com.trashmelody.di.DaggerAppComponent; did you forget to inherit a required module?
      [ERROR] Line 178: No source code is available for type com.trashmelody.di.AppModule; did you forget to inherit a required module?

Значит ли это, что мы должны inherit все ошибки в xml?

...