Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object Disposed Exception #1194

Closed
Nickolas- opened this issue Mar 31, 2016 · 42 comments
Closed

Object Disposed Exception #1194

Nickolas- opened this issue Mar 31, 2016 · 42 comments

Comments

@Nickolas-
Copy link

After some time my CI start to raise unhandled Object Disposed exception. IOS works fine, problem in android.

Target "android-package" (fun () ->
    AndroidPackage (fun defaults ->
        {defaults with
            ProjectPath = "project path"
            Configuration = "Release"
            OutputPath = "out path"
        })
    |> AndroidSignAndAlign (fun defaults ->
        {defaults with
            KeystorePath = "Tollminder.keystore"
            KeystorePassword = getBuildParamOrDefault "pass" ""
            KeystoreAlias = "tollminder"
            ZipalignPath = "path/build-tools/23.0.2/zipalign"
        })
    |> ignore
)

After in build it try to create "Signed" apk.

Verifying alignment of ...*Aligned.apk (4)...Finished Target: android-package

Starting Target: android-hockey (==> android-package)
      50 META-INF/MANIFEST.MF (OK - compressed)
   17780 META-INF/TOLLMIND.SF (OK - compressed)
   35700 META-INF/TOLLMIND.RSA (OK - compressed)
   36850 AndroidManifest.xml (OK - compressed)
   38699 res/anim/abc_fade_in.xml (OK - compressed)
   38989 res/anim/abc_fade_out.xml (OK - compressed)
   39296 res/anim/abc_grow_fade_in_from_bottom.xml (OK - compressed)
   39755 res/anim/abc_popup_enter.xml (OK - compressed)
   40091 res/anim/abc_popup_exit.xml (OK - compressed)
   40446 res/anim/abc_shrink_fade_out_from_bottom.xml (OK - compressed)
   40908 res/anim/abc_slide_in_bottom.xml (OK - compressed)
   41209 res/anim/abc_slide_in_top.xml (OK - compressed)
   41514 res/anim/abc_slide_out_bottom.xml (OK - compressed)
   41815 res/anim/abc_slide_out_top.xml (OK - compressed)

Unhandled Exception:
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Stream has been closed'.
  at System.IO.FileStream.BeginRead (System.Byte[] array, Int32 offset, Int32 numBytes, System.AsyncCallback userCallback, System.Object stateObject) <0x1a2aca0 + 0x00256> in <filename unknown>:0
  at System.Diagnostics.AsyncStreamReader.ReadBuffer (IAsyncResult ar) <0x8565930 + 0x0033b> in <filename unknown>:0
  at System.IO.Stream+ReadWriteTask.InvokeAsyncCallback (System.Object completedTask) <0x186a2b0 + 0x0004c> in <filename unknown>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x196a230 + 0x001bb> in <filename unknown>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x196a1f0 + 0x00033> in <filename unknown>:0
  at System.IO.Stream+ReadWriteTask.System.Threading.Tasks.ITaskCompletionAction.Invoke (System.Threading.Tasks.Task completingTask) <0x186a320 + 0x000ef> in <filename unknown>:0
  at System.Threading.Tasks.Task.FinishContinuations () <0x19579f0 + 0x0020c> in <filename unknown>:0
  at System.Threading.Tasks.Task.FinishStageThree () <0x1955cc0 + 0x0006b> in <filename unknown>:0
  at System.Threading.Tasks.Task.FinishStageTwo () <0x1955b90 + 0x00115> in <filename unknown>:0
  at System.Threading.Tasks.Task.Finish (Boolean bUserDelegateExecuted) <0x19559e0 + 0x0008a> in <filename unknown>:0
  at System.Threading.Tasks.Task.ExecuteWithThreadLocal (System.Threading.Tasks.Task& currentTaskSlot) <0x19567a0 + 0x00135> in <filename unknown>:0
  at System.Threading.Tasks.Task.ExecuteEntry (Boolean bPreventDoubleExecution) <0x1956650 + 0x000df> in <filename unknown>:0
  at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () <0x19565b0 + 0x00025> in <filename unknown>:0
  at System.Threading.ThreadPoolWorkQueue.Dispatch () <0x196f180 + 0x001d8> in <filename unknown>:0
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () <0x19709c0 + 0x00017> in <filename unknown>:0

And after FAKE do some target I get some chinese symbols

Starting Target: core-build (==> clean)
卍畂汩⁤畡潴搭瑥捥楴湯›獵湩⁧獭畢汩⁤敶獲潩㐧〮‧牦浯✠䰯扩慲祲䘯慲敭潷歲⽳潍潮昮慲敭潷歲嘯牥楳湯⽳⸴⸴⼰楬⽢潭潮㐯㔮⸧䄊汬瀠捡慫敧⁳楬瑳摥椠慰正条獥挮湯楦⁧牡⁥污敲摡⁹湩瑳污敬⹤
义但⠠敲瑳牯⥥›潃灭瑵摥挠潯楫⁥慪⁲慰桴›唯敳獲港捩潫慬獳灨瑯湥潫ⸯ慸慭楲⵮牣摥湥楴污ੳ

FAKE version 4.22.9
Mac OS X El Capitan v. 10.11.3
Zipalign r. 23.0.2

Update 1 april 2016:
Now ios stop building too.

  1) System.Exception: Error while posting to HockeyApp.
Messages: ≻楴汴≥∺潔汬業摮牥椠协Ⱒ戢湵汤彥摩湥楴楦牥㨢挢浯琮汯浬湩敤≲∬異汢捩楟敤瑮晩敩≲∺㝥㐷㌹㙡㜴㥥㠴㐹㙡㥡㔹戲攱㘳捡ぢⰢ瀢慬晴牯≭∺佩≓∬敲敬獡彥祴数㨢ⰰ挢獵潴彭敲敬獡彥祴数㨢畮汬∬牣慥整彤瑡㨢㈢㄰ⴵ㈱㌭吰㤰㔺㨷㌰≚∬灵慤整彤瑡㨢㈢㄰ⴶ㐰〭吱㐱〺㨴㤲≚∬敦瑡牵摥㨢慦獬ⱥ椢≤㈺㜶㌲ⰰ挢湯楦彧牵≬∺瑨灴㩳⼯楲歮栮捯敫慹灰渮瑥洯湡条⽥灡獰㈯㜶㌲⼰灡彰敶獲潩獮㘯Ⱒ瀢扵楬彣牵≬∺瑨灴㩳⼯楲歮栮捯敫慹灰渮瑥愯灰⽳㝥㐷㌹㙡㜴㥥㠴㐹㙡㥡㔹戲攱㘳捡ぢⰢ洢湩浩浵潟彳敶獲潩≮∺⸸∰∬敤楶散晟浡汩≹∺偩潨敮椯潐≤∬瑳瑡獵㨢ⰲ瘢獩扩汩瑩≹∺牰癩瑡≥∬睯敮≲∺汇牯畩敔档潮潬楧獥Ⱒ漢湷牥瑟歯湥㨢戢㙤ㄶ㝤㝡昹慤㘸㐶扣晤㐱挷挰昵㜳㙣戲㘸散≥∬潣灭湡≹∺汇牯畩敔档潮潬楧獥索㈊㄰ 

What it can be ?

@kentcb
Copy link
Contributor

kentcb commented Apr 4, 2016

I'm seeing similar strangeness in #1196. I just found this because I also get ObjectDisposedException, though mine was during an attempt to restore packages. In addition, I get the asian characters in the output.

@kentcb
Copy link
Contributor

kentcb commented Apr 4, 2016

In this particular case, it was not repeatable. I just ran my exact same script again and this time it worked. However, there are still a heap of asian characters in the output.

Also, #1196 seems to "fail" every time.

@Nickolas-
Copy link
Author

When I start IOS hockey my script failed with this exception, but when I open a new tab in ITerm2 , everything start to build properly, but than appear again.

@Nickolas-
Copy link
Author

Hello guys , still got this error. Any ideas ?

@kentcb
Copy link
Contributor

kentcb commented Jun 6, 2016

Still getting this with 4.28.0 :(

[10:49:41][package-android] 慪⁲楳湧摥ਮ圊牡楮杮›上琭慳漠⁲琭慳散瑲椠⁳牰癯摩摥愠摮琠楨⁳慪⁲獩渠瑯琠浩獥慴灭摥‮楗桴畯⁴⁡楴敭瑳浡Ɒ甠敳獲洠祡渠瑯戠⁥扡敬琠慶楬慤整琠楨⁳慪⁲晡整⁲桴⁥楳湧牥挠牥楴楦慣整猧攠灸物瑡潩慤整⠠〲㌴〭ⴸㄲ
牯愠瑦牥愠祮映瑵牵⁥敲潶慣楴湯搠瑡⹥
[10:49:41][package-android] 
[10:49:41][package-android] Unhandled Exception:
[10:49:41][package-android] System.ObjectDisposedException: Cannot access a disposed object.
[10:49:41][package-android] Object name: 'Stream has been closed'.
[10:49:41][package-android]   at System.IO.FileStream.Read (System.Byte[] array, Int32 offset, Int32 count) <0x1a2a260 + 0x00230> in <filename unknown>:0 
[10:49:41][package-android]   at System.IO.Stream.<BeginReadInternal>m__2 (System.Object ) <0x18697a0 + 0x0008a> in <filename unknown>:0 
[10:49:41][package-android]   at System.Threading.Tasks.Task`1[TResult].InnerInvoke () <0x1b9d8c0 + 0x0008f> 24195 in <filename unknown>:0 
[10:49:41][package-android]   at System.Threading.Tasks.Task.Execute () <0x1955bd0 + 0x0004d> in <filename unknown>:0 
[10:49:41][package-android] --- End of stack trace from previous location where exception was thrown ---
[10:49:41][package-android]   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x18aa010 + 0x00035> in <filename unknown>:0 
[10:49:41][package-android]   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x18a7830 + 0x000b7> in <filename unknown>:0 
[10:49:41][package-android]   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x18a7790 + 0x00087> in <filename unknown>:0 
[10:49:41][package-android]   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x18a7740 + 0x0003f> in <filename unknown>:0 
[10:49:41][package-android]   at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x1ba2a30 + 0x0001f> 24317 in <filename unknown>:0 
[10:49:41][package-android]   at System.IO.Stream.EndRead (IAsyncResult asyncResult) <0x1868620 + 0x00071> in <filename unknown>:0 
[10:49:41][package-android]   at System.IO.FileStream.EndRead (IAsyncResult asyncResult) <0x1a2a930 + 0x00039> in <filename unknown>:0 
[10:49:41][package-android]   at System.Diagnostics.AsyncStreamReader.ReadBuffer (IAsyncResult ar) <0x96d7150 + 0x00036> in <filename unknown>:0 
[10:49:41][package-android]   at System.IO.Stream+ReadWriteTask.InvokeAsyncCallback (System.Object completedTask) <0x1869ba0 + 0x0004c> in <filename unknown>:0 
[10:49:41][package-android]   at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x1969c50 + 0x001bb> in <filename unknown>:0 
[10:49:41][package-android]   at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x1969c10 + 0x00033> in <filename unknown>:0 
[10:49:41][package-android]   at System.IO.Stream+ReadWriteTask.System.Threading.Tasks.ITaskCompletionAction.Invoke (System.Threading.Tasks.Task completingTask) <0x1869c10 + 0x000ef> in <filename unknown>:0 
[10:49:41][package-android]   at System.Threading.Tasks.Task.FinishContinuations () <0x1957410 + 0x0020c> in <filename unknown>:0 
[10:49:41][package-android]   at System.Threading.Tasks.Task.FinishStageThree () <0x19556e0 + 0x0006b> in <filename unknown>:0 
[10:49:41][package-android]   at System.Threading.Tasks.Task.FinishStageTwo () <0x19555b0 + 0x00115> in <filename unknown>:0 
[10:49:41][package-android]   at System.Threading.Tasks.Task.Finish (Boolean bUserDelegateExecuted) <0x1955400 + 0x0008a> in <filename unknown>:0 
[10:49:41][package-android]   at System.Threading.Tasks.Task.ExecuteWithThreadLocal (System.Threading.Tasks.Task& currentTaskSlot) <0x19561c0 + 0x00135> in <filename unknown>:0 
[10:49:41][package-android]   at System.Threading.Tasks.Task.ExecuteEntry (Boolean bPreventDoubleExecution) <0x1956070 + 0x000df> in <filename unknown>:0 
[10:49:41][package-android]   at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () <0x1955fd0 + 0x00025> in <filename unknown>:0 
[10:49:41][package-android]   at System.Threading.ThreadPoolWorkQueue.Dispatch () <0x196eba0 + 0x001d8> in <filename unknown>:0 
[10:49:41][package-android]   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () <0x19703e0 + 0x00017> in <filename unknown>:0

@molinch
Copy link
Contributor

molinch commented Jun 8, 2016

Same here :(

@Nickolas-
Copy link
Author

It's very important bug , that stopped our CI for a while.

@forki
Copy link
Member

forki commented Jun 15, 2016

any ideas what to do?

@kentcb
Copy link
Contributor

kentcb commented Jun 15, 2016

I do have Xamarin support looking into this and other issues. Basically I gave them my whole project and said here, this should build on both mono and Windows but doesn't on either. They have confirmed issues and said they'd get back to me. Will update this thread when they do.

@bartdkmediahuis
Copy link

Thanks for the update kentcb !
Also facing a similar issue after upgrading from mono 4.2.1 to 4.4.0

You have a temporary workaround available ? Since this is breaking our CI environment as well.

@ewan-fraedom
Copy link

Same problem. seems intermittent

@ghost
Copy link

ghost commented Jun 16, 2016

Same issue - causing us serious issues :-(

@forki
Copy link
Member

forki commented Jun 16, 2016

// cc @nosami

@bartdkmediahuis
Copy link

Any idea on where to look for a certain solution ?
Can we fork with a given fix or something ?

Did you guys do a rollback of mono ? Since rollback of FAKE does not fix this issue.

@bgidwani
Copy link

As a workaround till the issue is fixed, updated TeamCity to invoke the following

#ignore "cannot access a disposed object" exception
[[ $(mono --runtime=v4.0 ../tools/FAKE.exe build.fsx $@>&1) =~ "System.ObjectDisposedException: Cannot access a disposed object." ]]

This is used only for Android Package target from CI tool, so the exception is ignored and the build does not fail.

@ewan-fraedom
Copy link

whereabouts do you put that line? in the fake script? we have already set TC to ignore all errors for the moment. Seem to get the Chinese characters intermittently on a number of different build steps atm. seems to be when a shell command is run?

@ewan-fraedom
Copy link

we also get the hockey app problem, although it seems to succeed despite the odd characters

@bgidwani
Copy link

@ewan-fraedom the code is not part of the fake script. This is a regular shell script that invokes the Fake script (build.fsx file) and ignores the object disposed exception.

You can save the script in a android-package.sh file and invoke the script as follows -
./android-package.sh android-package buildmode=QA ..... (any additional parameters for FAKE script)

@ewan-fraedom
Copy link

gotcha

@varon
Copy link

varon commented Jun 16, 2016

Also experiencing this on a similar setup - TeamCity, Xamarin, OS X for an Android build.
After signing an APK using XamarinHelper.AndroidSignAndAlign, I'm met with the same Chinese characters and the ObjectDisposedException.

I've tried a few alternative approaches to the trapping suggested by @bgidwani, but nothing seems to reliably prevent the error.

For now I'm just going to build on Windows (which so far seems to not fail, or at least fail a lot less). I'd greatly appreciate a workaround that preserves logs, and will be happy to provide more information or help with testing any possible fixes.

@alexsorokoletov
Copy link
Contributor

alexsorokoletov commented Jun 16, 2016

Got these crashes after upgrading to the cycle 7 Xamarin. Sometimes build works fine, sometimes I see object disposed. After compiling Android. Though I do not get any Chinese characters.

@bartdkmediahuis
Copy link

Which version of the zipAlign tool are you using when executing the AndroidSignAndAlign ?
The object dispose catch did not solve the issue.

@alexsorokoletov
Copy link
Contributor

alexsorokoletov commented Jun 17, 2016

~/Library/Developer/Xamarin/android-sdk-macosx/build-tools/23.0.1/zipalign
23.0.3 produces the same result

Is there a way to debug this exception to find out which file and who's trying to access?

@alexsorokoletov
Copy link
Contributor

Hey guys, just catched something very unusual in the build log

Time Elapsed 00:01:32.7578650
jar signed.

Warning: 
No -tsa or -tsacert is provided and this jar is not timestamped. Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (2046-04-08) or after any future revocation date.
Verifying alignment of /Users/jen....Android/bin/Ad-Hoc/com....android-SignedAndAligned.apk (4)...
      50 META-INF/MANIFEST.MF (OK - compressed)
   15160 META-INF/COM_EAST.SF (OK - compressed)
   30430 META-INF/COM_EAST.RSA (OK - compressed)
   31579 AndroidManifest.xml (OK - compressed)
   32954 res/anim-v21/design_bottom_sheet_slide_in.xml (OK - compressed)
   33351 res/anim-v21/design_bottom_sheet_slide_out.xml (OK - compressed)
   33724 res/anim/abc_fade_in.xml (OK - compressed)
   34014 res/anim/abc_fade_out.xml (OK - compressed)
   34321 res/anim/abc_grow_fade_in_from_bottom.xml (OK - compressed)
   34780 res/anim/abc_popup_enter.xml (OK - compressed)
   35116 res/anim/abc_popup_exit.xml (OK - compressed)
   35471 res/anim/abc_shrink_fade_out_from_bottom.xml (OK - compressed)
   35933 res/anim/abc_slide_in_bottom.xml (OK - compressed)
   36234 res/anim/abc_slide_in_top.xml (OK - compressed)
[ARTEFACT] APK at: ....Android/bin/Ad-Hoc/com.....android_Ad-Hoc_1.0.374_Signed.apk
Finished Target: Android
   36539 res/anim/abc_slide_o

Here you can see that aligner is still verifying the apk while the code after validation is already executing in F#!

This is the code

      AndroidPackage (fun defaults ->
        {defaults with
            ProjectPath = csprojName
            Configuration = configuration
            OutputPath = outputDir
            Properties = androidParameters
        }) 
      |> AndroidSignAndAlign (fun defaults ->
        {defaults with
            KeystorePath = keystorePath
            KeystorePassword = keystorePassword
            KeystoreAlias = keystoreAlias
            ZipalignPath = zipalignPath
            JarsignerPath = jarsignPath
        })
      |> ignore

      traceStartTask "android-package-name" "renaming APK to reflect versioning and configuration"
      let apkName = Path.Combine(outputDir, String.Format("{0}-Signed.apk", AndroidPackageName))
      let apkFinalName = Path.Combine(outputDir, String.Format("{0}_{1}_{2}.{3}_Signed.apk", AndroidPackageName, configuration, version, buildNumber))
      File.Move(apkName, apkFinalName)
      traceEndTask "android-package-name" ""

      trace ("[ARTEFACT] APK at: " + apkFinalName)
      if not <| String.IsNullOrEmpty shouldPublish then
        UploadAndroidToHockey apkFinalName

What am I doing wrong?

@alexsorokoletov
Copy link
Contributor

Here is what I did to get rid of the problem.
Due to the fact I got chinese characters also #1213 I was looking into fixing the part with encoding and found out that XamarinHelper is using very specific way to start process and this way doesn't specify UTF-8 encoding.

To test my strategy I basically made a copy of AndroidSignAndAlign and called ExecProcessAndReturnMessages which adds UTF-8 settings. Chinese disappeared at once and as a bonus zipalign and jarsign tasks are now awaited as they should be.

If you see the output from previous message, the log had like 20 messages from zipalign but in reality there are almost 500 lines in the output from zipalign that were never displayed (even in the old builds which did not fail and run on the mono 4.2 before Xamarin cycle 7 update).
I believe we have a problem in XamarinHelper with not waiting for the process to finish and only with mono 4.4 the problem started to cause crashes during build.

My guess is that it's related to the garbage collection changes but who knows. I'll test the changes for a few days and will make a PR.

Appreciate any feedback or comments

@forki
Copy link
Member

forki commented Jun 18, 2016

Awesome. Please send pr
On Jun 17, 2016 22:59, "Alex Sorokoletov" notifications@github.com wrote:

Here is what I did to get rid of the problem.
Due to the fact I got chinese characters also #1213
#1213 I was looking into fixing
the part with encoding and found out that XamarinHelper is using very
specific way to start process and this way doesn't specify UTF-8 encoding.

To test my strategy I basically made a copy of AndroidSignAndAlign and
called ExecProcessAndReturnMessages which adds UTF-8 settings. Chinese
disappeared at once and as a bonus zipalign and jarsign tasks are now
awaited as they should be.

If you see the output from previous message, the log had like 20 messages
from zipalign but in reality there are almost 500 lines in the output from
zipalign that were never displayed (even in the old builds which did not
fail and run on the mono 4.2 before Xamarin cycle 7 update).
I believe we have a problem in XamarinHelper with not waiting for the
process to finish and only with mono 4.4 the problem started to cause
crashes during build.

My guess is that it's related to the garbage collection changes but who
knows. I'll test the changes for a few days and will make a PR.

Appreciate any feedback or comments


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#1194 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AADgNILUvOYFL5yFJDc_gMrXmLdWN7pGks5qMwrFgaJpZM4H866M
.

@bartdkmediahuis
Copy link

@alexsorokoletov thanks for the update !
Any chance a similar issue occurs when running the hockeyapp helper ?

With version .29 we are getting this exception :

17:54:53]System.Exception: Error while posting to HockeyApp. [17:54:53]Messages: ≻楴汴≥∺效⁴楎略獷汢摡Ⱒ戢湵汤彥摩湥楴楦牥㨢挢浯洮摥慩畨獩洮扯汩慥灰⹳敮獷灡⹰扮⹯污桰≡∬異汢捩楟敤瑮晩敩≲∺㝡㈹㐱㑤㌲㘹ㄹ㕥晡㠸挶㐹ㅥ戵晣㈸Ⱒ瀢慬晴牯≭∺湁牤楯≤∬敲敬獡彥祴数㨢ⰲ挢獵潴彭敲敬獡彥祴数㨢∢∬牣慥整彤瑡㨢㈢㄰ⴵ㠰㈭吸㤰㐺㨳㤱≚∬灵慤整彤瑡㨢㈢㄰ⴶ㘰ㄭ吹㔱㔺㨴㌵≚∬敦瑡牵摥㨢慦獬ⱥ爢汯≥〺∬摩㨢㈲㌲㌷∬潣普杩畟汲㨢栢瑴獰⼺爯湩⹫潨正祥灡⹰敮⽴慭慮敧愯灰⽳㈲㌲㌷愯灰癟牥楳湯⽳㘴∱∬異汢捩畟汲㨢栢瑴獰⼺爯湩⹫潨正祥灡⹰敮⽴灡獰愯㤷ㄲ搴㈴㤳㤶攱愵㡦㘸㥣攴㔱换㡦∲∬業楮畭彭獯癟牥楳湯㨢㐢ㄮⰢ搢癥捩彥慦業祬㨢畮汬∬瑳瑡獵㨢ⰲ瘢獩扩汩瑩≹∺牰癩瑡≥∬睯敮≲∺敍楤桡極≳∬睯敮彲潴敫≮∺愸散㈴攰㘰挴昸扡㘴戸㝥愲敤晦〵㔰㈰㘵㕤㐴Ⱒ挢浯慰祮㨢䴢摥慩畨獩索㈊㄰ [17:54:53]Errors: [17:54:53] [17:54:53] at Fake.HockeyAppHelper.HockeyApp (Microsoft.FSharp.Core.FSharpFunc2 setParams) <0x9197e70 + 0x003df> in :0 `

@ewan-fraedom
Copy link

also in AndroidPackage

[android-package] /Library/Frameworks/Mono.framework/Commands/mono "tools/xpkg/xamarin-component.exe" restore ../TravelApp.sln
[14:33:01][android-package] Process output:
[14:33:01][android-package] "义但⠠敲瑳牯⥥›潃灭瑵摥挠潯楫⁥慪⁲慰桴›唯敳獲猯浡牵楡挭⽩砮浡牡湩挭敲敤瑮慩獬䤊䙎⁏爨獥潴敲㨩嬠崪删獥潴楲杮砠浡牡湩愮瑵⁨ㅶ㈮㌮ㄮ䤊䙎⁏爨獥潴敲㨩嬠崪匠捵散獳畦汬⁹敲瑳牯摥砠浡牡湩愮瑵⁨ㅶ㈮㌮ㄮ"

@alexsorokoletov
Copy link
Contributor

Is it happening only with 4.29?

@alexsorokoletov
Copy link
Contributor

Can reproduce, will be fixing the problem

Alex

On Jun 20, 2016, at 09:49, ewan chilton notifications@github.com wrote:

also in AndroidPackage

[android-package] /Library/Frameworks/Mono.framework/Commands/mono "tools/xpkg/xamarin-component.exe" restore ../TravelApp.sln
[14:33:01][android-package] Process output:
[14:33:01][android-package] "义但⠠敲瑳牯⥥›潃灭瑵摥挠潯楫⁥慪⁲慰桴›唯敳獲猯浡牵楡挭⽩砮浡牡湩挭敲敤瑮慩獬䤊䙎⁏爨獥潴敲㨩嬠崪删獥潴楲杮砠浡牡湩愮瑵⁨ㅶ㈮㌮ㄮ䤊䙎⁏爨獥潴敲㨩嬠崪匠捵散獳畦汬⁹敲瑳牯摥砠浡牡湩愮瑵⁨ㅶ㈮㌮ㄮ"


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@ewan-fraedom
Copy link

ewan-fraedom commented Jun 20, 2016

hmm ok so 4.28

[10:31:10][android-package] Starting Target: android-package
[10:31:13][android-package] 卍畂汩⁤畡..... LOTS of incorrectly encoded stuff
[10:31:14][android-package] Task: MSBuild ../source/TravelApp.Droid/TravelApp.Droid.csproj

4.29

[android-package] Starting Target: android-package
... lots of properly encoded stuff
[15:02:21][android-package] /Library/Frameworks/Mono.framework/Commands/mono "tools/xpkg/xamarin-component.exe" restore ../TravelApp.sln
[15:02:22][android-package] Process output:
[15:02:22][android-package] "义但⠠敲瑳牯⥥›.... etc SOME incorrectly encoded stuff
[15:02:22][android-package] Task: MSBuild ../source/TravelApp.Droid/TravelApp.Droid.csproj
[15:02:22][android-package] Building project: ../source/TravelApp.Droid/TravelApp.Droid.cspr
....
....
[15:03:46][android-package] jarsigner -sigalg SHA1withRSA -digestalg SHA1 -keystore
[15:03:47][android-package] Process output:
[15:03:47][android-package] "慪⁲楳湧摥ਮ圊牡......................... etc etc
[15:03:47][android-package] zipalign -f -v 4
[15:03:47][android-package] Process output:
[15:03:47][android-package] "敖楲祦湩⁧污杩..................... etc etc
[15:03:47][android-package] Publishing artifacts (2s)
[15:03:47][android-package] ##teamcity[publishArtifacts
[15:03:47][android-package] Finished Target: android-package

@alexsorokoletov
Copy link
Contributor

Problem identified, checking the fix and will provide a fresh pull request soon

@forki forki closed this as completed in 425ff23 Jun 20, 2016
alexsorokoletov added a commit to alexsorokoletov/FAKE that referenced this issue Jun 20, 2016
alexsorokoletov added a commit to alexsorokoletov/FAKE that referenced this issue Jun 20, 2016
forki added a commit that referenced this issue Jun 20, 2016
@ewan-fraedom
Copy link

still getting some enconding issues with 4.29.2

[12:03:31][core-build] Build property string
[12:03:35][core-build] 卍畂汩⁤畡潴搭瑥捥楴湯›獵湩⁧獭畢汩⁤敶獲潩㐧〮.....

@alexsorokoletov
Copy link
Contributor

@ewan-fraedom I had to rollback encoding fixes in all processes cause this turned out to be much more complex issue that should be addressed.
4.29.2 should have encoding fixed with XamarinHelper

@aspnetde
Copy link

An update to 4.29.2 did the trick for me. I also noticed that the output directory of the .ipa changed, so I had to make some adjustments in my configuration here as well. But at least it works now with the latest Mono bits again.

@ewan-fraedom
Copy link

yeah the output directory change is v annoying. is it fake related though? we tried to fix by specifiing outputdir and/or outputpath but found that it incorrectly appends the filename to the last directory.

ie

outputdir = ./bin/iPhone -> ./bin/IphoneMyApp.ipa

when really you want

./bin/iPhone/MyApp.ipa

@aspnetde
Copy link

That's a mess I gave up on ;-).

What happens with the iOS helper:

iOSBuild (fun defaults ->
    { defaults with
        BuildIpa = true
        ProjectPath = "src/Xyz.csproj"
        Configuration = "AdHoc"
        Platform = "iPhone"
        Target = "Build"
        OutputPath ="ios-build/bin/"
    })

Given that configuration I would expect to find everything within ios-build/bin/. Instead some stuff including the *.dSYM goes one level up, and for the actual IPA an sub directory is being created, but not within ios-build/bin/, but one level up, too. So the ipa ends in ios-build/bin{name-of-the-ios-csproj} {timestamp}/.

@ewan-fraedom
Copy link

yeah best i can tell is that its not using the default output path of the bin dir and then MSBuild or whatever is doing its default 'no output path' behaviour

then if you specify the output path there is a bug where it treats the last dir as something to prepend to the filename. tried all variations of ./directory/./ etc

@aspnetde
Copy link

Yep, and so did I. I am suffering a little OCD here knowing files are thrown in directories where they do not belong, but as I don't have to watch it while it's running on the build agent, I can live with that. It's just a bit annoying to figure out how things (not) work.

(But my F# knowledge is to limited at this point to dig deeper and provide a fix.)

@alexsorokoletov
Copy link
Contributor

alexsorokoletov commented Jun 30, 2016

So the ipa ends in ios-build/bin{name-of-the-ios-csproj} {timestamp}/

There is a bug for that in Xamarin http://stackoverflow.com/questions/37726925/xamarin-cycle-7-ios-ipa-output-now-in-a-datetime-folder/

@aspnetde
Copy link

aspnetde commented Jun 30, 2016

I think those are two different things. The one thing is that folder with the timestamp, the other, storing everything outside the configured target directory, is more likely to be FAKE/XamarinHelper related.

It ends in ios-build/bin{name-of-the-ios-csproj} {timestamp}/, but it really should end in ios-build/bin/{name-of-the-ios-csproj} {timestamp}/

@kentcb
Copy link
Contributor

kentcb commented Jun 30, 2016

The IPA output path change is a separate issue that I have also been hounding Xam support about. It's apparently been fixed, but not released yet. See https://bugzilla.xamarin.com/show_bug.cgi?id=41963 for discussion and possible interim workarounds.

smh at how this got through to stable.

nosami added a commit to nosami/Yaaf.FSharp.Scripting that referenced this issue Oct 7, 2016
See
fsprojects/FAKE#1196,
fsprojects/FAKE#1212,
fsprojects/FAKE#1213 &
fsprojects/FAKE#1194

Not sure of the ramifications of this change, but this fixes the
encoding issues in FAKE for me.

l.Head.Encoding was
`System.IO.StringWriter(new System.Text.StringBuilder()).Encoding`
which evaluates to utf-16
/cc:@forki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants