Rush • A new and improved way of building extensions

@UsesPermissions(permissionNames = “android.permission.MODIFY_AUDIO_SETTINGS”)

When I add this line, I get a error,

│ ERR src\com\speaker.java:12: error: cannot find symbol
│ import com.google.appinventor.components.annotations.UsesPermissions;
│ ^
│ symbol: class UsesPermissions
│ location: package com.google.appinventor.components.annotations

│ ERR src\com\speaker.java:17: error: cannot find symbol
@UsesPermissions(permissionNames = “android.permission.MODIFY_AUDIO_SETTINGS”)
│ ^
│ symbol: class UsesPermissions
│ warning: The following options were not recognized by any processor: ‘[output, org, root, version, extName]’

│ Total error(s): 2
└ Failed

What could be the reason and how will I solve this?

see this - Rush • A new and improved way of building extensions - Extension Development - MIT App Inventor Community

Thanks, I got it

1 Like
<?xml version="1.0" encoding="utf-8"?>

<manifest

xmlns:android="http://schemas.android.com/apk/res/android"

package="com.loudspeaker">

<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

<!-- For more details, see: https://github.com/ShreyashSaitwal/rush-cli/wiki/Android-Manifest-File -->

<application>

  <!-- <activity android:name=".MainActivity">

        <intent-filter>

            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />

        </intent-filter>

    </activity> -->

</application>

But no permission prompt when app starts

check app settings what are the permissions granted maybe it i already granted

The uses-permissions tag only grants your app to use functions which requires this permission, when the protection level of the permission is normal, or allow your to prompt the user to grant the permission either from within your app or manually from the app settings, if the permission protection level is dangerous.
Declaring the permission using the uses-permission tag, will not prompt the user to grant the permission, you have to programmatically do it, Appinventor provides an easy approach to do that by invoking the Form.askPermission(String, PermissionRequestHandler) method.
However, for your case, you will not require to prompt the user to grant the permission, because it’s protection level is already normal, you can safely use the methods that needs this permission after declaring it in rush’s AndroidManifest.xml, as you did.

2 Likes

This post was flagged by the community and is temporarily hidden.

:sparkles: Rush 1.1.1 :sparkles:


What’s new :face_with_monocle:


  • You can now see how much time each build took.

    image

  • …umm, yeah. That’s it. This is not a major release after all.

Bug fixes :beetle:


  • Fixed the inconsistent behavior of property-type blocks. [ref]

  • Fixed the issue where the extension’s assets and the license file won’t get compiled within the AIX file.

  • Fixed the unnecessary invalidation of caches while building the extension. This resulted in slightly increased build times.

  • Fixed the issue that sometimes caused the Java warning to show more than once.

  • Fixed some other minor issues.

Internal changes :dart:


  • There’s been quite a few improvements in the working of the Rush installer (a.k.a rush-init). You, as an end-user, won’t notice many changes (expect the perky progress bar :wink:), but this will lay the foundation for an upcoming feature that will allow you to upgrade Rush without leaving your terminal.

Installation :wrench:


  • If you already have Rush installed on your computer, simply download the Rush installer for your OS from the latest release and run it.

  • If you don’t have Rush installed, follow this wiki to install it.


Cheers,
Shreyash
6 Likes

wow 1 sec!!!

1 Like

It’s likely that’s just boilerplate code you get, nothing special. Larger extensions will take a longer amount of time to build (normally 5 to 8 seconds for me), as usual.

1 Like

Rush 1.1.2 HOTFIX


With the previous release (v1.1.1), an issue cropped up that caused the APK creation to fail if the extension used any external library.

So, if you recently upgraded Rush to v1.1.1, I urge you to upgrade it to v1.1.2 ASAP.

Bug fixes :beetle:


  • Fixed the issue that caused APK creation to fail when using external libraries.

Installation :wrench:


  • If you already have Rush installed on your computer, simply download the Rush installer for your OS from the latest release (v1.1.2), and then run it (it will only update the affected files).

  • If you don’t have Rush installed, follow this wiki to install it.


Cheers,
Shreyash
6 Likes

Can you help me?
I followed all the steps to install Rush, then I went to build, there is practically nothing there, I just created it and when I went to build it, it returned these errors.

Have you installed JDK 8?

Yes
image

You have JRE; you need to install JDK (version 8).

4 Likes


I get this error while trying to build the generated project, how can i fix it?

Hello all!

Recently I conducted a survey, which very few participated in. Previously I was trying to convince @Shreyash to include the Android R Prebuilt Platform SDK in Rush, which would allow extension developers to develop extensions for Android R. Currently if you type Build.VERSION_CODES. into IntelliJIDEA (or an IDE with “code completion”), Build.VERSION_CODES.R will not appear. That is because Rush is using the The Android Q Prebuilt Platform SDK, which App Inventor uses since they target Android Q. @Shreyash will not be including the Android R Prebuilt Platform SDK in Rush, but instead stick to App Inventors cycle (which is slow).

Although it’s at his discretion to include the Android R Platform SDK or not, you could of course upgrade it locally by yourself. There are two ways to do this.

  • Globally
  • Per-project

:information_source: To make sure you understand the process, this is only meant for IDEs which have “code completion” for Java (and when building with Rush, since it checks methods against dependencies), such as IntellIJIDEA. The “dev-deps” directory is meant for development dependencies and aren’t included in your final extension, they are simply there so that your IDE can use “code completion,” which makes it easier for you to code!

:earth_americas: Globally

:information_source: This is a good guide if you want to replace the “android.jar” automatically for future created projects. If you have previously created projects, follow the “Per project” guide.

  • Locate the folder that Rush has created; “C:\Users\user\AppData\Roaming\rush”
    • This was created with v1.1.0. You will have to find the directory which you unzipped Rush into if you still use anything below v1.1.0.
  • Now go into “dev-deps”
    • This is where development dependencies are located, they aren’t included with your extension.
  • Download the Prebuilt Platform SDK from one of the following links
    • Android R Prebuilt Platform SDK from MEGA.NZ
      • The Android R Prebuilt Platform SDK is from the official release of Android R.
    • Android S Prebuilt Platform SDK from MEGA.NZ
      • The Android S Prebuilt Platform SDK is from the Android S Beta 1. I will modify the link when the candidate release for Android S is released.
  • Now that you’ve downloaded one of the Prebuilt Platform SDKs, you can rename it to “android.jar”
  • Drag and drop the new “android.jar” in place of the old one
  • Create a new project with Rush by running “rush create ProjectName” in a command prompt, and you’re set to go!
    • This change won’t take affect on previously created projects. Follow the “Per project” guide if you want to upgrade a previously created project.

:file_folder: Per project

:information_source: Steps between this and the “Global” guide are similar, however, directories and some steps are different.

  • Locate the folder of your project; “C:\Users\user\Desktop\ProjectName”
  • Now go into “dev-deps”
    • This is where development dependencies are located, they aren’t included with your extension.
  • Download the Prebuilt Platform SDK from one of the following links
    • Android R Prebuilt Platform SDK from MEGA.NZ
      • The Android R Prebuilt Platform SDK is from the official release of Android R.
    • Android S Prebuilt Platform SDK from MEGA.NZ
      • The Android S Prebuilt Platform SDK is from the Android S Beta 1. I will modify the link when the candidate release for Android S is released.
  • Now that you’ve downloaded one of the Prebuilt Platform SDKs, you can rename it to “android.jar”
  • Drag and drop the new “android.jar” in place of the old one
    • If you’re asked if you want to overwrite the old “android.jar,” select “Yes”
  • Select “File” then “Reload all from Disk” from IntelliJIDEA
    • If you don’t use IntelliJIDEA, restart your IDE for changes to take affect. This might automatically happen though.
    • Sometimes IntelliJIDEA will automatically do this, however, we want to make sure it actually happens!
  • Start coding and build your extension with Rush by running “rush build” in a command prompt, and you’re set to go!

Hello @Shreyash,

Solve this problem please,

I’m using latest version of rush and try to build the default java which generated by rush automatically.

image

Downgrade to JDK 8; compiling against versions higher than that isn’t currently supported.

1 Like

Try this version jdk - 1.8.0
https://www.oracle.com/in/java/technologies/javase/javase8u211-later-archive-downloads.html#license-lightbox

first remove jdk bin path if there is any
then install the jdk from above link
install it and add bin path to system variable