bugs, coding, developer, Flutter, flutterdev, iOS, Xcode

PhaseScriptExecution failed with a nonzero exit code

This is by far one of the most common yet nerve-racking errors encountered when developing with Xcode either through Swift or Flutter to run for iOS.

The first urge when one encounters this even if it is not their first time is to run straight to stackoverflow; I’m not an exception. In fact, I spent 24hrs straight surfing through over hundreds of stackoverflow fixes for it. As pleasing and convincing even high rated most of the solutions where, they all didn’t help me fix it; instead they increased my frustration to the point of me almost wanting to reset my app’s configurations.

Funny thing is the solutions to it from Stackoverflow were endless, everyone seems to have widely different ways they overcame it!! overwhelming and confusing right??

1 of the multiple solutions
2 of the multiple solutions
3 of the multiple solutions

Stackoverflowing with just this error message ‘PhaseScriptExecution failed with a nonzero exit code’ is synonymous to gambling!

So, in the past, somehow when I encountered it, stackoverflow fixed it for me without any hassle, but the second time which was much recently it didn’t because the underling issue didn’t much the solutions that appealed to me over there.

Eureka Moment

It was when my eyes finally got blessed and instead of just stackoverflowing lazily, I just calmed myself and noticed the error message which was “file not found”.

so simple right? yeah! it really pained me that I spent so much time on such a straightforward issue.

Its a generic error message!! don’t search for it, instead read the much more detailed error message above it!

Real error here is: Unknown command located in the file path provided right after the colon on the first line in the image above

So in this case it would be super super hard for you to find help with the more specific fixes present on stackoverflow for it. This is because, let’s be real what are the chances that another person will be using that same incompatible command with you, 1%.

What was the underlining issue behind mine?

It was simple, the flutter path I provided for my project was incorrect! And it happened because I had decided to leave my work laptop back at the office so that I use my personal one over the weekend to work on an urgent new feature for work and I had forgotten after pulling the changes from DevOps repository to switch the flutter path to that of my personal laptop.

Don’t be so quick to stackoverflow, sometimes just chill and read your error messages right! it might save you more time!

why did such a simple error have to give me so much pain and no sleep, cos I didn’t sleep during this time! it was simply because I was searching wrong and not even paying attention to the straightforward details provided by Apple on why I am unable to run my app.

Conclusion

when you have this error, take your time and read the details or origin of the issue right below the error title like I said above; Then you can stackoverflow in peace!

coding, developer, Java, programming, python

Python_indentation is_part of_the code_itself

>>>Python_indentation == "__Can drive you crazy in the beginning__!"

python

My Python journey began exactly a month ago, and nothing about it drove me crazy like it indentation. My sole source of learning the language was the Python 101  book by Michael Driscoll.

Well, the Python 101  book did a very good job at telling me indentation was important but what I didn’t get was why and what will happen if I didn’t indent. I mean when I was learning Java and JavaScript, there were numerous books that said indentation was a good practice. So I told myself when I was writing my python code that my code will still run even if I didn’t indent.

That thought and carelessness of knowledge acquisition became my worst nightmare as I found myself spending over eight hours trying to figure out why my code wasn’t running.

The syntax error below became my worse nightmare with it recurrence:

SyntaxError: unindent does not match any outer indentation level

After series of youtube videos and stack Overflow, I finally came to understand the relevance of the Python indentation, which I low-key started to refer to as Python curly bracket -{}. The relevance and significance of the indentation in Python is due to the absence of curly bracket in the language. Unlike other programming languages that use curly braces to show the context or inclusion of lines of codes, python uses indentation.

indent

The code above results into the syntax error below:

error

So why is the code not running? its simple, after the if-statement, Python was expecting a line of code to end it but all it found was a print-statement, which occurs on the same line as the if-statement, making it independent of the if-statement and confusing the python shell which knows or assumes the print-statement should belong to the context of the if-statement.

How do we solve this? we make the print-statement dependent on the if-statement by making it occur on a column(col) greater than it:

Note: a column increase leads to a shift to the right of a character’s position.

col "if-statement" == 0
if-statement

col "print-statement" == 4
print-statement

so now the code will run because the print-statement has been made dependent on the if-statement.

run

The indentation(col) of the print-statement could have been anything aside zero as zero will make it independent or out of the context of the if-statement. The 4-length indentation is the most popular length used by Python programmers.

Also: because I started my code with an indentation of length-4, I need to maintain the same length across the current Python module. indent.py

To exit the if-statement, I will move back to the column 0 of whichever line I am currently on or prefer to be(i.e Ln:x col:0).

col0

I would not have faced the problem of indentation if Python were to be my first programming language because then I would not have taken indentation for granted. Before you start learning Python, bare in mind that indentation is_part of_the code_itself.

coding, developer, Java, programming, Uncategorized

The Sensitive Ancestor : Java

Looking back now after getting very familiar with other programming languages i.e JavaScript, PHP and Python, I know for sure, Java could never have worked as choice two.

meHN! never say never, it could have but all I am trying to say is it would have been hundred percent harder for me to transition from a weakly typed language like JavaScript and Python to Java.I mean imagine learning that a variable upon declaration could belong to any datatype (int, string, float) and also that at any given point in time you could also change it’s content to a whole new different datatype i.e weakly typed language:

Only to transition to a strongly typed language like Java where you not only need to specify the datatype of the variable upon declaration but also need to note that the variable datatype could never be changed, i.e if you declare a variable with a particular datatype, perhaps an array of type int, int[] array; you cannot insert string values into it i.e array = new int {"Maya","Java"}this won’t work! It will result in a big fat error which I can guarantee will drive you crazy!

Java is an interesting language to start with as a developer if you are hoping to gain more exposure to the very basic and fundamentals of programming. It was only when I was learning Java that I knew I had to be careful with anything and everything I typed.

Don’t get me wrong every programming language has it own frustrating side but for this particular blog, we are talking about the ancestor of all programming languages_ Java! The language I still owe most of my comfort and easy transition into other programming languages to.

If you are not sure about the language to start with as a new developer, I will advise you start with Java because even though it will frustrate and most likely make you feel dumb, you will thank the universe for it for every other new programming language you transition into.

Uncategorized

The Developer Journey Begins

Thanks for joining me!

Good company in a journey makes the way seem shorter. — Izaak Walton

post

I am Sumaya Ahmed Salihs, a current computer science student at the African Leadership College, Mauritius (ALC ). I started this blog to share my experience as a Student developer and lover of programming. This blog is my way of sharing the joy, passion and adventures I pass through in the technical field with like minded individuals.