How to fix "Termination Reason: Namespace CODESIGNING, Code 0x2" error in flutter?

8.7k Views Asked by At

I wrote an app with flutter and it is running on my iPhone in debug mode. Now i want to send it to my employer, So i've create an ad-hoc version of my app and create a "Diawi" link. After that i did check the app on my device and the app is installed on my device but not working and keep crashing after tap on the app icon.

My app icon was a round icon and i did change it to square.

Here i found when checking windows->devices :

Exception Type: EXC_BAD_ACCESS (SIGKILL - CODESIGNING)

Exception Subtype: UNKNOWN_0x32 at 0x00000001046c1c80

.

.

.

Termination Reason: Namespace CODESIGNING, Code 0x2

Triggered by Thread: 13

Is it possible that it's related to creating a bad provisioning profile?

Is there anyone faced this problem?

Any help would be appreciated.

3

There are 3 best solutions below

0
On BEST ANSWER

The reason the app was crashing because when you execute flutter run the app runs in debug mode. Adhoc build requires release configuration in the flutter project.

When you run flutter build ios --release it sets the Xcode to release configuration post which you can create an Adhoc build and share it via diawi link.

Many people are struggling with this. I myself spent a few days figuring out what was the issue.

1
On

After a few days set back, I've finally found the reason for this error. Xcode defaults to building a debug build. To avoid this, enter "flutter build ios" in the flutter terminal. Then build in Xcode

1
On

Finally i can solve this issue and the solution is so weird. For solving this issue:

1- Change the bundle id

2- Create provisioning profile for Ad-hoc and App store

Then you can make an add hoc export and create a Diawi link.

This worked for me and i hope can help the others.