Hi everyone,

I had a functional application working fine, using TinyIoC for DI.

In particular one of my classes looks like this:

public class ProcessLogin : AsyncCommand<string, int, CommandResult>
    {
        private IDataService _dataService;
        private Context _context;
        private ProgressDialog _progressDialog;
        private Action<CommandResult> _callback;

        public ProcessLogin(IDataService dataService) { _dataService =
dataService; }
        ......

After upgrading to the latest MonoDroid, packaging the app fails and I get
the following in the output:

...
AddOnPlatformLibraries:
  E:\Program Files (x86)\Java\jdk1.6.0_24\bin\javac.exe -d
obj\Debug\android\bin\classes -classpath "C:\Program Files (x86)\Reference
Assemblies\Microsoft\Framework\MonoAndroid\v2.2\mono.android.jar"
-bootclasspath "E:\Program Files
(x86)\Android\android-sdk\platforms\android-8\android.jar" -encoding UTF-8
"@C:\Users\Administrator\AppData\Local\Temp\tmp3959.tmp" 
obj\Debug\android\src\pique\mobility\apps\whereru\commands\ProcessLogin.java(26,3):
error :  cannot find symbol [F:\Git\Pique
Softworks\Pique.Mobility.Apps.WhereRU\src\Pique.Mobility.Apps.WhereRU\Pique.Mobility.Apps.WhereRU.csproj]
obj\Debug\android\src\pique\mobility\apps\whereru\commands\ProcessLogin.java(26,3):
error : symbol  : constructor AsyncCommand_3(java.lang.Object) [F:\Git\Pique
Softworks\Pique.Mobility.Apps.WhereRU\src\Pique.Mobility.Apps.WhereRU\Pique.Mobility.Apps.WhereRU.csproj]
obj\Debug\android\src\pique\mobility\apps\whereru\commands\ProcessLogin.java(26,3):
error : location: class pique.mobility.utilities.android.AsyncCommand_3
[F:\Git\Pique
Softworks\Pique.Mobility.Apps.WhereRU\src\Pique.Mobility.Apps.WhereRU\Pique.Mobility.Apps.WhereRU.csproj]
obj\Debug\android\src\pique\mobility\apps\whereru\commands\ProcessLogin.java(26,3):
error :                 super (p0); [F:\Git\Pique
Softworks\Pique.Mobility.Apps.WhereRU\src\Pique.Mobility.Apps.WhereRU\Pique.Mobility.Apps.WhereRU.csproj]
obj\Debug\android\src\pique\mobility\apps\whereru\commands\ProcessLogin.java(26,3):
error :  [F:\Git\Pique
Softworks\Pique.Mobility.Apps.WhereRU\src\Pique.Mobility.Apps.WhereRU\Pique.Mobility.Apps.WhereRU.csproj]
  Note: Some input files use unchecked or unsafe operations.
  Note: Recompile with -Xlint:unchecked for details.
  1 error
...

If I fall back to setter injection, removing the constructor altogether and
including this line instead:

        public IDataService DataService { get { return _dataService; } set {
_dataService = value; } }

everything works again.

Is there a way to disable the over-zealous safety checking? Seems like
constructor injection would be a fairly reasonable thing to be able to do.

Any suggestions welcome.

Thanks in advance,

Joe


--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Mono-for-Android-4-Constructor-injection-causes-packaging-failure-tp5057049p5057049.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to