Rush • A new and improved way of building extensions

It will remove compile time conflicts only. AI2 bundles gson library and that's why you see runtime error.
Better enable proguard for gson lib.

Thanks for your reply @vknow360 . Upon reviewing the MIT App Inventor sources, I noticed that the included Gson library version is 2.1, which is significantly older than the current latest version, 2.10.1.

During my investigation, I discovered that the class com.google.gson.ToNumberPolicy, which is causing a NoClassDefFoundError in my project, was introduced in Gson version 2.8.9. This class is not present in the older version (2.1) used by MIT App Inventor, leading to the aforementioned runtime error.

Could anyone suggest how to resolve this issue?Thanks again

How do I Update to the Latest Google Gson Version for Extension Development with Rush?

Hello MIT App Inventor Community,
I'm currently developing an extension and need to utilize the latest features available in Gson, specifically those introduced in version 2.8.9 and above. However, I've encountered issues due to the older version of Gson (2.1) that is integrated by default with Rush also in MIT App inventor sources.

Could anyone provide guidance or best practices on how to successfully update or configure my Rush project to use the latest Gson version (2.10.1)? I am particularly interested in:

  1. Steps to include the newer Gson library in a Rush-based extension project.
  2. Potential configuration settings or changes required in Rush to avoid conflicts with the pre-existing older Gson version.
    Your suggestions would be greatly appreciated.
    Thank you for your support!

Repackage gson library.

Thanks for your answer, can you please tell me how I can do that. Guidance will be of great help. Thanks @vknow360

Build with Proguard.
rush build -r

1 Like

some tutorial how can add kotlin third library i am trying to build using korge third library but i dont get some guide for add librarys

i am trying to understand how can make a extension using rush and kotlin. somebody can helpme? i see the tutorial for java but for kotlin i cant find a tutorial.

See first post for how to install RUSH.

When creating a new project, select Kotlin.

The demo project should look like this:

package com.metricrat.testkotlin

import com.google.appinventor.components.annotations.SimpleFunction
import com.google.appinventor.components.runtime.AndroidNonvisibleComponent
import com.google.appinventor.components.runtime.ComponentContainer
import com.google.appinventor.components.runtime.util.YailList

class Testkotlin(container: ComponentContainer) : AndroidNonvisibleComponent(container.`$form`()) {

    @SimpleFunction(description = "Returns the sum of the given list of integers.")
    fun SumAll(integers: YailList): Int {
        return integers.sumOf {
          it.toString().toIntOrNull() ?: 0
        }
    }
}

Just replace any java code with kotlin code

Getting this error while trying to build extension in rush.

husnain@Husnain-Macbook-Pro rsuhfix % rush build -r
                      __
     _______  _______/ /_
    / ___/ / / / ___/ __ \
   / /  / /_/ (__  / / / /
  /_/   \__,_/____/_/ /_/

• Build initialized

┌ Checking project files
│ info Checking metadata file (rush.yml)
│ info Checking AndroidManifest.xml file
└ done
┌ Compiling sources
│ info Picked 2 source files
└ done
┌ Processing the extension
│ info Linking extension assets and dependencies
│ erro FileSystemException: Cannot create file, path = '/Users/husnain/rush/workspaces/pk.rushfix.rsuhfix/art/META-INF/' (OS Error: Is a directory, errno = 21)
└ failed

How I can fix this error @shreyash. Is it related to file permissions?

it says it's a directory delete it (after backing it up possibly) and then try it again. If it does not work, then just put the backup back

After deleting the directory, during rebuild it created the same directory.

Oh then I don't know. Sorry...

1 Like

Try creating the file yourself

Hello everyone,

I'm working on an extension using Rush CLI and need help implementing helper blocks using enums. I've tried a few approaches, but I'm running into issues with YAIL type conversion and block visibility in MIT App Inventor.

What I've Done:

  • Created an enum to represent options like Option1, Option2, and Option3.
  • Implemented a method to use this enum, but it's causing IllegalStateException during compilation, and sometimes the blocks don't show up in the Blocks Editor.

What I Need:

  • Best practices for implementing helper blocks with enums in Rush CLI.
  • How to resolve type conversion issues.
  • Working examples or guidance.

Any help or advice would be greatly appreciated!

Thank you

Sorry, no Helper blocks in RUSH yet. Will hopefully be available when version 2 comes

1 Like

You forgot that you can (if you are courageous) implement yourself in your private Rush-cli the so long awaiting "helpers feature" with this Release v2.0.0 by shreyashsaitwal · Pull Request #48 · shreyashsaitwal/rush-cli · GitHub

I am in deadlock and this is the only way. Wish me luck.

How to build v2 branch?

1 Like

I tried but to no avail. It's still incomplete and gives build errors.

After clicking the first link, where should i go?
.github
assets
bin
lib
processor
schema
scripts/install
gitattributes
gitignore
LICENSE
README.md
analysis_options.yaml
pubspec.yaml

where should i go?