Rush • A new and improved way of building extensions

An extension can not be a visible component.

Are there any good ways to render to the screen then?

What do you mean by 'render' ?

Show an Android View while not overwriting the entire screen

Also, if extensions can't be visible, what is
com.google.appinventor.components.runtime.AndroidViewComponent
used for?

There are a lot of extensions which work with Android views. You can find them in community or in Taifun's extension directory.
Fortunately some of them are open source so you can make use of them to learn more about using Android views in AppInventor.

Extensions can change/add android views to screen.
This import accepts all User Interface (visible) components as argument.

2 Likes

Somehow I ran into an issue. :sleepy:

rush upgrade
info Fetching data...
info Starting download... [151 MB]
                                                            (0% done)
Unhandled exception:
DioError [DioErrorType.other]: HandshakeException: Connection terminated during handshake
Source stack:
#0      DioMixin.fetch (package:dio/src/dio_mixin.dart:473)
#1      DioMixin.request (package:dio/src/dio_mixin.dart:468)
#2      DioForNative.download (package:dio/src/entry/dio_for_native.dart:84)
#3      UpgradeCommand.run (package:rush_cli/commands/upgrade_command/upgrade_command.dart:89)
<asynchronous suspension>
#4      CommandRunner.runCommand (package:args/command_runner.dart:209)
<asynchronous suspension>

#0      DioMixin.fetch.<anonymous closure> (package:dio/src/dio_mixin.dart:628)
#1      _RootZone.runBinary (dart:async/zone.dart:1692)
#2      _FutureListener.handleError (dart:async/future_impl.dart:175)
#3      Future._propagateToListeners.handleError (dart:async/future_impl.dart:779)
#4      Future._propagateToListeners (dart:async/future_impl.dart:800)
#5      Future._completeError (dart:async/future_impl.dart:610)
#6      _SyncCompleter._completeError (dart:async/future_impl.dart:61)
#7      _Completer.completeError (dart:async/future_impl.dart:33)
#8      Future.any.onError (dart:async/future.dart:544)
#9      _RootZone.runBinary (dart:async/zone.dart:1692)
#10     _FutureListener.handleError (dart:async/future_impl.dart:175)
#11     Future._propagateToListeners.handleError (dart:async/future_impl.dart:779)
#12     Future._propagateToListeners (dart:async/future_impl.dart:800)
#13     Future._completeError (dart:async/future_impl.dart:610)
#14     Future._asyncCompleteError.<anonymous closure> (dart:async/future_impl.dart:666)
#15     _microtaskLoop (dart:async/schedule_microtask.dart:40)
#16     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49)
#17     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:122)
#18     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:193)

Of course, you can create a view or widget using an extension. But App Inventor will not provide a container for this view. The view created by the extension will not be visible in the ai2 designer. The view will only be created programmatically. However, you cannot create widgets that need xml. To place a programmatically created view on the screen, use the method of adding a view, e.g. to an arrangement passed to an extension.

2 Likes

I'd rather suggest you reinstall it from scratch than try to debug it. :sweat_smile:

1 Like

Thank you.
I thought it was due to ISP and GitHub issue ( the well known one, blocked by JIO ), so I changed dns to Google and AdGuard respectively but still got same issue.

Though there was no need to upgrade rush as I was just checking if there is update available or not.
I am happy with whatever build I have. :smile:

1 Like

Thanks for the hint. I can now render to an arrangement, but is there a way to make the view appear behind everything else, so that for example a canvas with and invisible background could be on top of it?

No, an extension cannot be a component visible in the designer. Built-in components, apart from the java code, have a container on the designer's side, visible in the designer. No such container is provided for extensions. You can add an arrangement, adjust its dimensions and color, or set the background of the arrangement to an image that will replace your view from the extension, nothing else...

my installation of rush is successful i open new terminal and try rush --help not getting proper echo

Add the EXPORT command to .bashrc, .profile, and .bashprofile and other profile files (if they exist).

Then do

source .bashrc; source .profile
1 Like

i get this error, everything looks fine.
but below error occurs

┌ Checking project files
│ info Checking metadata file (rush.yml)
│ info Checking AndroidManifest.xml file
└ done
┌ Compiling sources
│ info Picked 1 source file
└ failed

• Build failed [15ms] []

C:\Users\nathan\.rush\bin\test>

:question:

1 Like

JAVA_PATH and Installation is done correctly.
But ERROR occurs

Show result from:

Java -version

Doesn't work in Windows,
I tried in Linux, it works fine.
Thanks @Patryk_F

It works very well for me on Windows.

1 Like

What is the result of this command:

java -version && javac -version

The result output version should start with "1.8.x.x" (for Java 8)