Rush • A new and improved way of building extensions

I get this error when I try to build the extension
5436453

Your extension file is either empty and has no blocks, or you’re not using JDK 8.

Version JDK

package com.sgview.demo;

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.errors.YailRuntimeError;
import com.google.appinventor.components.runtime.util.YailList;

public class Demo extends AndroidNonvisibleComponent {

  public Demo(ComponentContainer container) {
    super(container.$form());
  }

  @SimpleFunction(description = "Returns the sum of the given list of integers.")
  public int SumAll(YailList integers) {
    int sum = 0;

    for (final Object o : integers.toArray()) {
      try {
        sum += Integer.parseInt(o.toString());
      } catch (NumberFormatException e) {
        throw new YailRuntimeError(e.toString(), "NumberFormatException");
      }
    }

    return sum;
  }
}

Can you try with this version of the JDK instead? Don’t forget to change your environment variables and restart your command prompt for changes to take effect if you put it in a different folder.

Is it possible to compile an extension with multiple components?

No, it’s not possible as of now.

1 Like

Hmm, okay, it would be useful but.

1 Like

:sparkles: Rush v1.2.1


Improvements :triangular_ruler:


  • Prior to this release, the positioning of extension blocks in the block-editor flyout was uncertain. This is now fixed and blocks should now appear in the same order (in their category) in which they are defined in the source file.

  • The install script for Linux and macOS is now compatible with most of the Unix shells (like, zsh, Bash, fish, etc.). Previously, it was only executable by Bash.

  • Migrated extensions will now be stored in a directory named {old_name}-rush to prevent the clashing of old extension files with the new ones.

Bug fixes :beetle:


  • Fixed the issue where running the upgrade command would result in a crash. [ref]

  • Fixed the issue where desugaring would fail if the project path contained spaces. [ref]

  • Fixed the issue where the extension’s icon won’t be visible in the component palette if it was a remote URL.

  • Fixed the issue that caused the exec format error: rush error when trying to use Rush on macOS. [ref]

Other changes :bulb:


  • Desugaring of Java 8 lang. features is now disabled by default for new extensions. It can be enabled in the metadata file (rush.yml).

Installation :hammer_and_wrench:


I regret to say this but…you won’t be able to use the rush upgrade command to upgrade Rush this time, as well. :pensive:
Like previous releases, you will need to run the install scripts this time also. Hopefully, this won’t happen again. :crossed_fingers:

Using PowerShell (Windows only)

iwr https://raw.githubusercontent.com/shreyashsaitwal/rush-cli/main/scripts/install/install.ps1 -useb | iex

Using Shell

curl https://raw.githubusercontent.com/shreyashsaitwal/rush-cli/main/scripts/install/install.sh -fsSL | sh

Cheers,
Shreyash

7 Likes

Hello @Shreyash thanks for the update but the newer update has this issue. I am not able to desugar my code properly. Everything was working fine with the previous version. But now I get this issue :

Is there a way to go back to previous version ?

Hello, @Shreyash I am just asking I don’t know much about this that in the future will the aar support come for rush? As currently in app inventor sources they are not giving AAR support. It will be great for extension developers if AAR support will come for rush :sweat_smile:

As far as I know, you are asking for aar support only because of R.txt file that generates resource references. For that you can use android studio as a workaround to to generate R.class files for you.

Yes you are right, but my main purpose for asking AAR support is for layout files too. Like some material component use

It must be implemented in AI2 before then rush can implement this.

How can you say only for R.txt? Better to use library src files instead of generating them by Android studio. Even by using sources you can edit them according to you.

If AAR support comes then it’s not necessary that you can make material components. Because some(Almost all) material components need theme to be defined in manifest file that’s not possible in an extension.

1 Like

Yes you are right but i just gave example

Error parsing command line: While parsing option --input F:\newRush\rush\bin\m\deps\MyLibrary-1.0.4.jar: F:\newRush\rush\bin\m\deps\MyLibrary-1.0.4.jar is not a valid path: it does not exist.

Please be a bit more specific and paste the complete build log here.

Build failed because of soo many source files?

│ info Picked 980 source files
└ failed

• Build failed [108ms] []

Just out of curiosity, how did you end up with so many source files for an extension?!

Copying out soo many files because jars don’t work :laughing:

Wdym? JARs should work!