<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shreyash Saitwal on Medium]]></title>
        <description><![CDATA[Stories by Shreyash Saitwal on Medium]]></description>
        <link>https://medium.com/@saitwalshreyash19?source=rss-5adff663123b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*hfIRvsYrEAG7CV4Z4BEdXg.png</url>
            <title>Stories by Shreyash Saitwal on Medium</title>
            <link>https://medium.com/@saitwalshreyash19?source=rss-5adff663123b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 20:02:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@saitwalshreyash19/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Writing your first App Inventor 2 extension]]></title>
            <link>https://saitwalshreyash19.medium.com/writing-your-first-app-inventor-2-extension-dc6d5d4ff824?source=rss-5adff663123b------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc6d5d4ff824</guid>
            <category><![CDATA[ai2-extensions]]></category>
            <category><![CDATA[mit-app-inventor-2]]></category>
            <category><![CDATA[app-inventor-2]]></category>
            <category><![CDATA[kodular]]></category>
            <dc:creator><![CDATA[Shreyash Saitwal]]></dc:creator>
            <pubDate>Sat, 23 May 2020 05:28:42 GMT</pubDate>
            <atom:updated>2021-03-13T15:58:47.040Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yzX9wchMueWpitD-" /><figcaption>Photo by <a href="https://unsplash.com/@emilep?utm_source=medium&amp;utm_medium=referral">Emile Perron</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Update 13 March 2021</h4><p>With the launch of Rush, which is improved tooling for building extensions, this article is now outdated. To know more about what Rush is and how to use it, check out <a href="https://community.appinventor.mit.edu/t/rush-a-new-and-improved-way-of-building-extensions/28699">this community post</a>.</p><p>Whether you&#39;ve just started using App Inventor 2 (and/or, Kodular) or you’ve built several apps with it already, you must have come across the term “Extensions”<strong> </strong>or “Extension Components” several times<strong>. </strong>Most of you must have been using them already and making awesome apps. But have you ever thought of creating them yourself?</p><p>In this guide, I’ll walk you through everything you’ll need to know to get started with extension development. We’ll make a simple extension that will add a gradient color background to components.</p><h4>What you’ll need</h4><ol><li>A computer or a laptop configured correctly to build extensions. If it’s not, first check out this article by me — <a href="https://medium.com/@saitwalshreyash19/writing-extensions-for-app-inventor-2-and-kodular-7d20092bff16?source=friends_link&amp;sk=1e2ce3fa85dd781c002c78c75ce83ccd">Configuring your computer to build App Inventor 2 extensions</a>. I’ll be waiting for you here, come back soon. 😊</li><li>Basic understanding of Java (or a similar OOP language).</li></ol><h3>Getting started 🚀</h3><p>Open the Extension Template or AI2 sources folder in your favorite text editor or IDE (I’d recommend VS Code or IntelliJ IDEA). Once opened, right-click on the src directory and create a new file named com/extensions/gradient/Gradient.java . The slashes <em>(</em><strong>/</strong><em>) </em>here<em> </em>represents a folder, so ultimately, you’ll end up with a directory structure like this:</p><pre>src<br>└──com<br>   └──extensions<br>      └──gradient<br>         └──Gradient.java</pre><p><strong>Observations 👀</strong></p><ol><li>It is the src directory where the extensions’ source files must be placed.</li><li>Since the package names and the directory structure of Java source files are very closely related, the package name our extension will be — com.extensions.gradient .</li><li>The class file Gradient.java will be the main source file of our extension. All the code that we’ll write will reside here.</li></ol><p>So, now that we’ve created our Gradient.java class file, let’s start writing the very first lines of code for our extension. But before that make sure you delete any autogenerated code created by your IDE.</p><p>Once done, simply copy the below block of code into the Gradient.java class file:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/58fb9a4f6bdbdbddba021a09710b30fc/href">https://medium.com/media/58fb9a4f6bdbdbddba021a09710b30fc/href</a></iframe><p><strong>Observations</strong></p><ol><li><strong>com.extensions.gradient</strong> is the package name of our extensions. Just like every Java file, it is necessary to add it to our extension’s Java file too.</li><li>The <strong>com.google.appinventor.*</strong> imports will give us access to various inner classes and annotations of AI2 that are needed for making extensions.</li><li><strong>@SimpleObject</strong> is one of the many annotations that the com.google.appinventor.components.annotations package provides. This annotation helps the compiler to distinguish between extension files and internal component files with the help of the external attribute.</li><li><strong>@DesignerComponent</strong> annotation is responsible for displaying the name, icon, description, and other information related about your extension into the component palette under the “Extensions” category.</li><li>The public class<strong> </strong><strong><em>Gradient</em></strong> is the main class of our extension. It extends the AndroidNonVisibleComponent class, which is the base class for all non-visible components in AI2. And because our extension is also a non-visible component, meaning that it won’t be visible in the designer preview as well as in the compiled app, we need to extend it with it.</li></ol><blockquote>App Inventor didn’t supported extension components from the very beginning. They were first introduced back in 2015, created as a part of 2015’s Google Summer of Code.</blockquote><p>Now, let’s move forward and create our very first purple-colored method block. This block will be the main block of our Gradient extension that will set the background color of a specified component to a gradient.</p><p>Copy the below block of code and add it to the Gradient class (replace //Write your code herewith the below code). The comments will help you to understand what’s going on in it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/935d41832c9ef8fec14f239755415d08/href">https://medium.com/media/935d41832c9ef8fec14f239755415d08/href</a></iframe><p><strong>Observations 👀</strong></p><ol><li><strong>@SimpleFuction</strong> annotation is responsible for giving our Java method the form of a purple block. It is provided by the imported com.google.appinventor.components.annotations.<strong>SimpleFunction</strong> class. We’ll keep the description of the block empty for now.</li><li>The name of our purple method block will be the same as the method name, i.e., <strong>SetGradientBackground</strong> .</li><li>The parameters of our method make up the sockets in the blocks. In this case, there would be four sockets respectively named as<strong>component </strong>, <strong>orientation</strong>, <strong>color1 </strong>and <strong>color2</strong>.</li><li>Notice the type of the parameter component — <strong>AndroidViewComponent</strong> . It is the base class of all visible/UI components. It allows us to pass a reference to any visible component to the component parameter.</li><li>The parameter orientation defines the orientation of the gradient.</li><li>The parameters color1 and color2 defines the colors of the gradient. In AI2, the color codes are in the int format, that’s why we need to set the type of these two to int .</li></ol><p>Great! Now that we’ve written our very first block, why not see it in action? So, let’s compile the extension to get the AIX file which we can load in AI2. To do so, open your IDE’s integrated terminal (or you can open the Terminal/Command Prompt in the Extension Template directory) and type ant extensions command.</p><p>Once the build is complete, you can find the extension file com.extensions.gradient.aix in a newly created folder, namely out , in the Extension Template.</p><p>Import the extension to AI2 (or, Kodular), drag-drop it to the viewer, and then go to the blocks section. You’ll see below blocks when you click the extension name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BdTN5R2u9qjllYzDfAsY_g.png" /><figcaption>MIT App Inventor 2</figcaption></figure><p>So far so good. We now know how to create the purple method block that doesn’t return anything (void). 💪</p><p>But don’t you think there seems to be an issue. Like, imagine what if someone inserted a wrong block in one of the sockets? The application will throw a runtime error and cause the application to crash. To avoid this, we’ll use the try-catch statement to handle the exception, and if an error occurs, we will call a yellow-colored event block.</p><p>So, let’s wrap the code in the SetGradientBackground method inside a try-catch statement like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/691c70e0a8c604231ed935c385b72805/href">https://medium.com/media/691c70e0a8c604231ed935c385b72805/href</a></iframe><p>Your IDE will now show you an error that the method ErrorOccured is undefined. Don’t worry, just copy the below block of code and paste it in the Gradient class and the error will go away.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eab7005c9270d52f95ee0d3c95d7ccf8/href">https://medium.com/media/eab7005c9270d52f95ee0d3c95d7ccf8/href</a></iframe><p><strong>Observations: 👀</strong></p><ol><li>Notice the <strong>@SimpleEvent </strong>annotation. It is responsible for creating the yellow-colored event block.</li><li>An event block should not return anything, i.e., it must be a “void”.</li><li>To make the event block work, we need to call the <strong>dispatchEvent()</strong> method from the EventDispatcher class.</li><li>The first argument of the method dispatchEvent(), this , refers to the current Activity, in simple words the screen of the application’s interface in which this event is being dispatched.</li><li>The second argument is the name of the method (or, event block), which in this case is &quot;ErrorOccured&quot; .</li><li>After the second argument, we need to pass the name of all the parameters that our method has. In this method, we have one parameter, error , so, we’ll pass it. In case we had more parameters, say, error , id , component , the dispatchEvent()method in our code would look like this: EventDispatcher.dispatchEvent(this, &quot;ErrorOccured&quot;, <strong>error</strong>, <strong>id</strong>, <strong>component</strong>) .</li></ol><p>Great! You’ve now successfully created an event block. Now compile your extension and import it to AI2 to see the block in action. 😉</p><p>Now, you might be wondering what does that orientation socket accepts? We cannot use any default AI2 block with it as it will not work. The only way to get it working is with a block that returns a GradientDrawable.Orientation object. So, let’s create some blocks that do the exact thing.</p><p>For this, we’ll create green colored property-type getter blocks that will return a GradientDrawable.Orientation object. Copy the below block of code and paste it in the Gradient class.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ab086ce9fd107a9a7f7f792f909a6997/href">https://medium.com/media/ab086ce9fd107a9a7f7f792f909a6997/href</a></iframe><p><strong>Observations 👀</strong></p><ol><li><strong>@SimpleProperty </strong>is used to create green colored property blocks.</li><li>If the method returns something, which, in our case is an Object , and <strong>does not</strong> have any parameters, it will create a property type getter block. Otherwise, it will create a property-type setter block.</li></ol><p>Similarly, we’ll create seven more such blocks that return different orientations. Like we did earlier, simply add them to the Gradientclass too.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eaf64db95a3626c0afd15b76d079d47f/href">https://medium.com/media/eaf64db95a3626c0afd15b76d079d47f/href</a></iframe><p>Awesome! Now once again, compile the extension and import it to AI2. You’ll now see a whole bunch of new green blocks.</p><p>Our extension is almost complete, but before we move further, let’s test the extension by changing a Horizontal Arrangement’s background color. So, let’s drag-drop a Horizontal Arrangement and a Button component in the designer. Set the height and width of the Horizontal Arrangement to fill parent. Finally, arrange the blocks like below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*Yc1um7mPUsy2YIHshbUrOg.png" /></figure><p>Build the app, or simply live test it with the companion. Open it and as soon as you click the button, the background of the arrangement will turn into a beautiful gradient.</p><p>But wait, as I said, the extension is not 100% complete yet, there’s a problem with the extension. You can only use the built-in color blocks to set the colors of the gradient. What if you want to use a HEX color code?</p><p>Let’s fix this by adding a new block that can parse the HEX code and convert it into an integer that our SetGradientBackgroundmethod can understand. To do this, we’ll create a purple-colored method block. So, add the below block of code to the Gradient class.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5c2a70610ef90d4c47b6096d5f43e20d/href">https://medium.com/media/5c2a70610ef90d4c47b6096d5f43e20d/href</a></iframe><p><strong>Observations 👀</strong></p><ol><li>You can also create method blocks that return something, like an int with the help of @SimpleFunction annotation.</li><li>The method parseColor() from the class android.graphics.Color parses a HEX color code into an integer.</li></ol><p>Nice! Our extension is now complete and ready to be used. But first, I want you to give our extension some finishing touches.</p><ul><li>Add a description to all the blocks using the description attribute. Also, add a description to the extension by using the description attribute in the @DesignerComponent annotation.</li><li>Add an icon to the extension. To do this, you have two options — 1. you can use an image URL and add it to the iconName attribute in the @DesignerComponent annotation or 2. use a local image.</li><li>To use a local image as the extension icon, first, create a folder named aiwebres at the same level/directory as your Gradient.java file and add your image to it. Now, in iconName attribute in the @DesignerComponent annotation of your Gradient.java file type this — &quot;aiwebres/<strong><em>YOUR_IMAGE_NAME</em></strong>.png . Replace <strong><em>YOUR_IMAGE_NAME </em></strong>with the actual name of your image.</li><li>Tip: For best results, use an image having dimensions of 16✕16 pixels.</li></ul><p>Excellent! Your extension is now 100% ready and you can use it in your apps! 😋</p><h3>What next 🔥</h3><p>There’s still a lot more to learn about extension components. The best way to learn on your own is by checking out <a href="https://github.com/mit-cml/appinventor-sources">App Inventor 2 sources</a>, and understanding how the internal components work.</p><p>Our Gradient extension currently only uses two colors to create gradients, so, as a challenge, I want you to modify the extension so that it can accept an indefinite list of colors and use those colors to make a gradient. So, give it try and let me know how it goes. Don’t forget to share your solution with me through <a href="http://t.me/ShreyashSaitwal">Telegram</a> or <a href="https://twitter.com/ShreyashSaitwal">Twitter</a>. 😃</p><p>If you’ve faced any difficulty while following the guide, please let me know in the comments or simply contact me through <a href="http://t.me/ShreyashSaitwal">Telegram</a> or <a href="https://twitter.com/ShreyashSaitwal">Twitter</a>. 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc6d5d4ff824" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configuring your computer to build App Inventor 2 extensions]]></title>
            <link>https://saitwalshreyash19.medium.com/writing-extensions-for-app-inventor-2-and-kodular-7d20092bff16?source=rss-5adff663123b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d20092bff16</guid>
            <category><![CDATA[extension]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[mit]]></category>
            <category><![CDATA[app-inventor-2]]></category>
            <category><![CDATA[kodular]]></category>
            <dc:creator><![CDATA[Shreyash Saitwal]]></dc:creator>
            <pubDate>Sat, 23 May 2020 05:28:13 GMT</pubDate>
            <atom:updated>2021-03-13T15:57:52.351Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2QuROh4mmDZJe-v5" /><figcaption>Photo by <a href="https://unsplash.com/@christianw?utm_source=medium&amp;utm_medium=referral">Christian Wiediger</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4><em>Update 13 March 2021</em></h4><p>With the launch of Rush, which is improved tooling for building extensions, this article is now outdated. To know more about what Rush is and how to use it, check out <a href="https://community.appinventor.mit.edu/t/rush-a-new-and-improved-way-of-building-extensions/28699">this community post</a>.</p><p>In this guide, I will help you to set up all the necessary things that you need to make extensions on your Mac or Windows machine. Let’s keep it short here and get started. 😉</p><h4>What you’ll need</h4><ol><li>About 15 to 20 minutes.</li><li>A computer or laptop (running on macOS or Windows).</li><li>Internet connection.</li></ol><p>For being able to build extensions, you’ll need a few things installed and set up on your computer. Let’s grab them. 🐱‍🏍</p><h3>1. Java Development Kit</h3><p>AI2 extensions are written in Java. And for our machine to be able to compile the Java code, we need to install a Java Development Kit (more commonly referred to as a JDK). I’m not going to get too deep into this as I assume you to be at least a bit familiar with Java.</p><h4><strong>For Windows users </strong>💻</h4><p><strong><em>Getting JDK:</em></strong></p><p>First, check if you’ve JDK already installed on your machine. To do this, open the <strong>Command Prompt </strong>and run this command — java -version . If you see an output similar to the one below then you’ve JDK already installed.</p><pre>java version &quot;1.8.0_251&quot;<br>Java(TM) SE Runtime Environment (build 1.8.0_251-b08)<br>Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)</pre><p>If you don’t see this, head over to <a href="https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html">https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html</a> and download the JDK (the provided link is for JDK 8). Once done, install it by following the <strong><em>Next </em></strong>and <strong><em>Install </em></strong>prompts.</p><p><strong><em>Setting up the Environment Variables</em></strong><em>:</em></p><ul><li>Right-click on the <strong>Computer</strong> icon from the desktop.</li><li>Choose <strong>Properties<em> </em></strong>from the context menu.</li><li>Click <strong>Advanced system settings</strong> link.</li><li>Select <strong>Environment Variables</strong>.</li><li>Now create a new entry named JAVA_HOMEif it doesn’t exist and enter the path where JDK is installed, for example, C:\Program Files\Java\java-1.8.0_251 .</li><li>Next, create another entry named PATH if it doesn’t exist and then paste this — %JAVA_HOME%\bin; %JAVA_HOME%\jre\bin; C:\ProgramData\Oracle\Java\javapath as the value. If it already contains some value, simply separate it with a semicolon (<strong>;</strong>).</li></ul><p><strong><em>Verifying the installation:</em></strong></p><p>Open <strong>Command Prompt</strong> and run this command — java -version . You will see an output similar to this:</p><pre>java version &quot;1.8.0_251&quot;<br>Java(TM) SE Runtime Environment (build 1.8.0_251-b08)<br>Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)</pre><h4><strong>For macOS users 🍎</strong></h4><p><strong><em>Getting JDK:</em></strong></p><p>First, check if you’ve JDK already installed on your machine. To do this, open the <strong>Terminal </strong>and run this command — java -version . If you see an output similar to the one below then you’ve JDK already installed.</p><pre>java version &quot;1.8.0_251&quot;<br>Java(TM) SE Runtime Environment (build 1.8.0_251-b08)<br>Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)</pre><p>If you don’t see this, head over to <a href="https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html">https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html</a> and download the JDK (the provided link is for JDK 8). Once done, install it by following the <strong><em>Continue </em></strong>and <strong><em>Install </em></strong>prompts.</p><p><strong><em>Setting up JAVA_HOME:</em></strong></p><ul><li>Open the <strong>Terminal </strong>once again.</li><li>Type vim ~/.bash_profile and hit enter. You’ll be shown a warning.</li><li>To continue, type E , and hit enter. A window will open</li><li>Now copy this line — export JAVA_HOME=$(/usr/libexec/java_home) and paste it in the window.</li><li>Press the Escape key and type :wq. Hit Enter.</li><li>Next, type source ~/.bash_profile and hit enter.</li><li>Finally, verify whether JAVA_HOME has been correctly set up or not by typing echo $JAVA_HOME and hit enter. You should see an output similar to this:</li></ul><pre>/Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home</pre><p><strong><em>Verifying the installation:</em></strong></p><p>Verify the installation by opening the <strong>Terminal </strong>and running java -version command. You will see an output similar to this:</p><pre>java version &quot;1.8.0_251&quot;<br>Java(TM) SE Runtime Environment (build 1.8.0_251-b08)<br>Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)</pre><h3>2. Apache Ant</h3><p>Apache Ant is a Java library and command-line tool which is used to build Java projects. AI2 uses Ant as its primary build system. And therefore, to build and pack our extensions up, we need to install Ant. Let’s not worry about it much and get it set up on our machine quickly. ⚡</p><h4><strong>For Windows users </strong>💻</h4><p><strong><em>Getting Ant:</em></strong></p><p>Go to <a href="https://ant.apache.org/bindownload.cgi">https://ant.apache.org/bindownload.cgi</a> and download the latest version of Ant. Unzip the downloaded ZIP file and place it in your desired location. Make sure not to place it in a directory with spaces in its name.</p><p><strong><em>Setting up the Environment Variables:</em></strong></p><ul><li>Follow the first four steps from JDK installation to open <strong>Environment Variables</strong> settings.</li><li>Create a new entry named ANT_HOME and as a value, enter the path of the location where you’ve unzipped Ant, for example, C:\Ant\apache\ant-1.10.1 .</li><li>Edit the PATH variable we created earlier and add this to it — %ANT_HOME%\bin . Make sure you add a semicolon (<strong>;</strong>) before adding it.</li><li>Create a new entry named CLASSPATH if it doesn’t exist and add this as value — %ANT_HOME%\bin . If it already has some value in it, make sure you separate it with a semicolon (<strong>;</strong>).</li></ul><p><strong><em>Verifying the installation:</em></strong></p><p>Open <strong>Command Prompt</strong> and run this command — ant -version . You should see an output similar to this:</p><pre>Apache Ant(TM) version 1.10.6 compiled on May 2 2019</pre><h4><strong>For macOS users 🍎</strong></h4><p><strong><em>Getting Ant:</em></strong></p><p>We’ll use <a href="http://brew.sh/">Homebrew</a> for this step, so, make sure you have installed it already. You can Google the installation process in case you don’t have it.</p><ul><li>Open the <strong>Terminal</strong> and run the following commands:</li></ul><pre>$ brew update<br>$ brew install ant </pre><ul><li>You’ll see an output similar to this:</li></ul><pre>==&gt; Installing dependencies for ant: openjdk<br>==&gt; Installing ant dependency: openjdk<br>==&gt; Downloading https://homebrew.bintray.com/bottles/openjdk-13.0.2+8_2.catalina.bottle.tar.gz<br>==&gt; Downloading from https://akamai.bintray.com/65/65adca036393f528e3830cab8b0aafec94be870de087d94cfe098fd5935<br>    ######################################################################## 100.0%<br>==&gt; Pouring openjdk-13.0.2+8_2.catalina.bottle.tar.gz<br>==&gt; Caveats<br>For the system Java wrappers to find this JDK, symlink it with<br>sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk</pre><pre>openjdk is keg-only, which means it was not symlinked into /usr/local,<br>because it shadows the macOS `java` wrapper.<br><br>If you need to have openjdk first in your PATH run:<br>echo &#39;export PATH=&quot;/usr/local/opt/openjdk/bin:$PATH&quot;&#39; &gt;&gt; ~/.bash_profile<br><br>For compilers to find openjdk you may need to set:<br>export CPPFLAGS=&quot;-I/usr/local/opt/openjdk/include&quot;<br><br>==&gt; Summary<br>🍺  /usr/local/Cellar/openjdk/13.0.2+8_2: 631 files, 314.6MB<br>==&gt; Installing ant<br>==&gt; Downloading https://www.apache.org/dyn/closer.lua?path=ant/binaries/apache-ant-1.10.7-bin.tar.xz<br>==&gt; Downloading from https://downloads.apache.org/ant/binaries/apache-ant-1.10.7-bin.tar.xz<br>    ######################################################################## 100.0%<br>==&gt; Downloading https://www.apache.org/dyn/closer.lua?path=ant/ivy/2.4.0/apache-ivy-2.4.0-bin.tar.gz<br>==&gt; Downloading from http://apache.mirrors.hoobly.com/ant/ivy/2.4.0/apache-ivy-2.4.0-bin.tar.gz<br>    ######################################################################## 100.0%<br>==&gt; Downloading https://www.apache.org/dyn/closer.lua?path=commons/bcel/binaries/bcel-6.4.0-bin.tar.gz<br>==&gt; Downloading from https://mirrors.gigenet.com/apache/commons/bcel/binaries/bcel-6.4.0-bin.tar.gz<br>#=#=#<br>curl: (22) The requested URL returned error: 404<br>Trying a mirror...<br>==&gt; Downloading https://archive.apache.org/dist/commons/bcel/binaries/bcel-6.4.0-bin.tar.gz<br>    ######################################################################## 100.0%<br>🍺  /usr/local/Cellar/ant/1.10.7_1: 1,670 files, 41.9MB, built in 33 seconds<br>==&gt; Caveats<br>==&gt; openjdk<br>For the system Java wrappers to find this JDK, symlink it with<br>sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk<br><br>openjdk is keg-only, which means it was not symlinked into /usr/local,<br>because it shadows the macOS `java` wrapper.<br><br>If you need to have openjdk first in your PATH run:<br>echo &#39;export PATH=&quot;/usr/local/opt/openjdk/bin:$PATH&quot;&#39; &gt;&gt; ~/.bash_profile<br><br>For compilers to find openjdk you may need to set:<br>export CPPFLAGS=&quot;-I/usr/local/opt/openjdk/include&quot; </pre><ul><li>Notice the path (/usr/local/Cellar/<strong>ant</strong>/1.10.7_1) after the 🍺 icon, which in my case is at the 18th line from the bottom, in the output. Copy and save it for later use.</li></ul><p><strong><em>Configuring .bash_profile:</em></strong></p><ul><li>Follow the first three steps from the <em>Setting up JAVA_HOME</em> section.</li><li>Enter the following stuff and replace &lt;WRITE HERE&gt;in the first line with the path that you copied in the previous step:</li></ul><pre>export ANT_HOME=<strong>&lt;WRITE HERE&gt;</strong><br>export PATH=${PATH}:${ANT_HOME}/bin</pre><ul><li>Hit Escape key, type :wq and hit enter.</li><li>Next, type source ~/.bash_profile and hit enter.</li><li>Finally, verify whether ANT_HOME has been correctly set up or not by typing echo $ANT_HOME and hit enter.</li></ul><h3><strong>3. Download the Extension Template repository</strong></h3><p>Extension Template is a system to help you build extensions. It was recently released by the MIT App Inventor team. With this, you no longer need to download the whole AI2 sources that are around 1.6 GB large to build extensions.</p><ul><li>First, go to this URL — <a href="https://github.com/mit-cml/extension-template">https://github.com/mit-cml/extension-template</a>. It will take you to the Extension Template’s GitHub repository.</li><li>Now, click on “Clone or download” and then download the repository by clicking on “Download ZIP”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*hCocDakWNfgkc8S4LqEvtw.png" /><figcaption>Extension Template repository — GitHub</figcaption></figure><ul><li>Once the downloaded, unzip the repo in your desired directory and you’re done.</li></ul><p><em>An alternate way of cloning the repository locally would be by using Git or GitHub Desktop, but to keep this tutorial as simple as possible, I haven’t covered it.</em></p><p>Great! Now your machine is successfully configured to build extension components for App Inventor 2 and its clones.</p><h3>What next 🔥</h3><p>Now that you have everything set up correctly, you can start developing your own extensions, but, in case you don’t know how to write extensions, check out this guide by me to get started — <a href="https://medium.com/@saitwalshreyash19/writing-your-first-app-inventor-2-extension-dc6d5d4ff824?source=friends_link&amp;sk=1138db0facf5b0195805bdba48597efd">Writing your first App Inventor 2 extension</a>. 😃</p><p>If you’ve faced any difficulty while following the guide, please let me know in the comments or simply contact me through my <a href="http://t.me/ShreyashSaitwal">Telegram</a> or <a href="https://twitter.com/ShreyashSaitwal">Twitter</a>. 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d20092bff16" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>