So after some further follow-up I can confirm there are two fixes:

1) Just print out the value of the variable in a Log.d. Believe it or not,
that "fixes" the code.
2) Change "float" into "double".

Based on customer reports I received, the bug only affected users running
API 15 or 16, and only some models of phones, not all (again, based on
customer reports). Still if you guys switch to Gradle using Proguard 4.9
with obfuscation on (even with optimization off), might want to watch out
for floating point conversions in your code, or just compile with
obfuscation off or export with Eclipse.

On Thu, Aug 8, 2013 at 2:17 PM, Digipom Inc. <digi...@gmail.com> wrote:

> Interesting, I wasn't aware of the strictfp modifier. It seems that
> changing one of the floats to a double may have fixed it... I sent out
> several more specific tests and waiting for the remote debugger to confirm.
> :)
>
>
> On Wed, Aug 7, 2013 at 5:12 PM, Nobu Games <dev.nobu.ga...@gmail.com>wrote:
>
>> If it is floating point related you could try adding the "strictfp"
>> modifier to your methods or classes that rely on platform-independent
>> floating point arithmetics.
>>
>>
>> On Wednesday, August 7, 2013 12:02:04 PM UTC-5, Digipom wrote:
>>>
>>> I figured it out -- I seem to have run into some sort of an obscure
>>> floating-point optimization bug that occurs on certain devices. I opened
>>> https://code.google.**com/p/android/issues/detail?**id=58698<https://code.google.com/p/android/issues/detail?id=58698>to
>>>  track the issue. I haven't found a workaround yet aside from exporting
>>> from Eclipse for now, but I'm trying different things like replacing floats
>>> with doubles to see if that makes a difference. It's slow-going since I
>>> can't reproduce the issue locally and rely on remote debugging. ;)
>>>
>>> On Sunday, August 4, 2013 3:42:52 PM UTC-4, Digipom wrote:
>>>>
>>>> Hello,
>>>>
>>>> I recently moved to Gradle from Eclipse so that I could have an easy
>>>> time of building from the command line, and at first I was very happy with
>>>> the Gradle build, until about 5% of the customers started emailing me and
>>>> complaining that the app was behaving strangely and not working correctly.
>>>> No crashes, just... behaving oddly, and only on 5% of the devices. The code
>>>> & Proguard config is identical, so it seems something bad is happening with
>>>> the way that the code is being generated. I haven't figured it out yet, but
>>>> I'm digging into things with apktool and I'm seeing a lot of differences
>>>> with the generated classes from the same class files, which I find strange
>>>> because the Proguard config that I'm feeding in is the same. Unfortunately,
>>>> I have to go back to manual builds with Eclipse for now due to this issue.
>>>>
>>>> Does anyone else have any similar experiences or insight into this? Are
>>>> the Eclipse / Gradle builds using different build tools behind the scenes
>>>> which could lead to differences in the generated code and cause some files
>>>> to be mis-generated? Thank you!
>>>>
>>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Android Developers" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/android-developers/h48v0STCW5o/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> android-developers+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
>
> --
> --
> Digipom
> http://www.digipom.com
>



-- 
-- 
Digipom
http://www.digipom.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to