Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pin Constraint Parameters are ignored on Android
#1
Hello,

I'm building a game for iOS and Android and I'm trying to integrate Obi Rope with it.

The progress was just great in the Editor but once I deployed a simple test to the Android device I noticed that all the Pin Constraints are being ignored when the scene started. I thought that there might be something wrong in my configuration so I went back and deployed the FreghtLift scene which is included in the Sample_Scenes (without any changes). But I also got the same result when I run it on the Android device. I've checked the value of ObiSolver.pinConstraintParameters.enabled at runtime on the device and it was true.

Please check out this recorded video for FreghtLift scene. The video shows how the platform falls immediately once the scene starts running on the Android device.
FreghtLiftScene_PinConstraintIssue_Android

Any idea what is going on? is there any special configuration that I need to take it into my consideration before I deploy the game to Android or iOS device?


Many thanks,
Acacus
Reply
#2
(09-10-2017, 11:55 AM)Acacus Wrote: Hello,

I'm building a game for iOS and Android and I'm trying to integrate Obi Rope with it.

The progress was just great in the Editor but once I deployed a simple test to the Android device I noticed that all the Pin Constraints are being ignored when the scene started. I thought that there might be something wrong in my configuration so I went back and deployed the FreghtLift scene which is included in the Sample_Scenes (without any changes). But I also got the same result when I run it on the Android device. I've checked the value of ObiSolver.pinConstraintParameters.enabled at runtime on the device and it was true.

Please check out this recorded video for FreghtLift scene. The video shows how the platform falls immediately once the scene starts running on the Android device.
FreghtLiftScene_PinConstraintIssue_Android

Any idea what is going on? is there any special configuration that I need to take it into my consideration before I deploy the game to Android or iOS device?


Many thanks,
Acacus

Hi there,

It recently came to our attention that there's a bug in Mono/IL2CPP that causes misaligned memory accesses in android. The result is a silent null reference in Mono that results in incorrect pin constraint handling, and a crash in IL2CPP when using pin constraints.

The (temporary) workaround we found is to comment lines: 202, 252, 260 of /Obi/Scripts/Oni.cs. They all look like this:
[StructLayout(LayoutKind.Sequential, Pack = 1)]

Turns out that when packing structs in certain Android devices, the compiler aligns the struct members to a memory address that is invalid in ARM architectures.
Reply
#3
(09-10-2017, 12:59 PM)josemendez Wrote: Hi there,

It recently came to our attention that there's a bug in Mono/IL2CPP that causes misaligned memory accesses in android. The result is a silent null reference in Mono that results in incorrect pin constraint handling, and a crash in IL2CPP when using pin constraints.

The (temporary) workaround we found is to comment lines: 202, 252, 260 of /Obi/Scripts/Oni.cs. They all look like this:
[StructLayout(LayoutKind.Sequential, Pack = 1)]

Turns out that when packing structs in certain Android devices, the compiler aligns the struct members to a memory address that is invalid in ARM architectures.

Thanks a lot josemendez ... It worked!


Many thanks,
Acacus
Reply