Rush • A new and improved way of building extensions

Solved thanks.

Error in update java jdk

I report this on an extension alredy builded with appy builder editor

Compiling Java files

│ │
│ ERR src\com\chiccovision\magnifier\Magnifier.java:33: error: cannot find symbol
│ import com.google.appinventor.components.common.YaVersion;
│ ^
│ symbol: class YaVersion
│ location: package com.google.appinventor.components.common

│ ERR src\com\chiccovision\magnifier\Magnifier.java:43: error: cannot find symbol
│ import com.google.appinventor.components.annotations.DesignerComponent;
│ ^
│ symbol: class DesignerComponent
│ location: package com.google.appinventor.components.annotations

│ ERR src\com\chiccovision\magnifier\Magnifier.java:48: error: cannot find symbol
│ import com.google.appinventor.components.annotations.SimpleObject;
│ ^
│ symbol: class SimpleObject
│ location: package com.google.appinventor.components.annotations

│ ERR src\com\chiccovision\magnifier\Magnifier.java:50: error: cannot find symbol
│ import com.google.appinventor.components.annotations.UsesPermissions;
│ ^
│ symbol: class UsesPermissions
│ location: package com.google.appinventor.components.annotations

│ ERR src\com\chiccovision\magnifier\Magnifier.java:53: error: cannot find symbol
│ import com.google.appinventor.components.common.YaVersion;
│ ^
│ symbol: class YaVersion
│ location: package com.google.appinventor.components.common

│ ERR src\com\chiccovision\magnifier\Magnifier.java:64: error: cannot find symbol
@DesignerComponent(version = 1, description = “This Extension was created with the AppyBuilder Code Editor.
” +
│ ^
│ symbol: class DesignerComponent

│ ERR src\com\chiccovision\magnifier\Magnifier.java:68: error: cannot find symbol
@SimpleObject(external = true)
│ ^
│ symbol: class SimpleObject

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

│ Total warnings: 1
│ Total errors: 8
└ Failed

• Build failed

Rush doesn’t support annotations like DesignerComponent and UsesPermissions, instead you need to define your extension’s metadata in the metadata file – rush.yml; and Android manifest elements, like required permissions, in the AndroidManifest.xml.

This is explained in detail here :point_down:

PS: You also don’t need to define the SimpleObject annotation, Rush automatically detects your extension’s Java class while compiling.

3 Likes

I seen solved thanks.
Great Job,Congratulation

1 Like

How to add dependency ?? any example.

To add an external library (JAR) to your extension,

  1. Download your desired JAR from the internet.
  2. Then, copy it into the deps directory.
  3. Finally, in rush.yml, add a new entry, with the exact same name of your JAR file which you copied into the deps directory, to the deps field. For example:
    deps:
      - my-library.jar
    
3 Likes
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        mavenCentral()
    }
}

and here the module for the app:

apply plugin: 'com.android.application'
android {
    compileSdkVersion 22
    buildToolsVersion "22.0.0"

    defaultConfig {
        applicationId "com.ozetastudios.climbbuddy"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

like this

Sorry, I’m unable to understand what you’re trying to say. Please elaborate more instead of just pasting irrelevant stuff.

i want to know the coding how to use show us an example, an example ( my_awesome_library) file coding, what what coding we should use there.

Did you read this post of mine :point_down:

ok i got it now

ok i did, but geting some error

Jar file is java zip file…similar file is AAr file… as it is an ofline builder you will have to manually implement the external library in… deps…folder…still any 1 can provide demo project or project link please provide…

Please be a bit more specific. What error(s) do you see?

Just for testing purposes …i try wit fb sdk

Screenshot_9

Your deps field isn’t correctly indented. There should be exactly 2 spaces before - YourLibrary.jar.

PS: AAR libraries aren’t yet supported by extensions. See this post.

PS-2: Ad extensions aren’t allowed in Kodular. You can get your community as well as creator account suspended if you use and/or distribute them.

i know but as i say just for testing purpose only. And i am in just learning stage in extension.

Exception in thread “main” java.lang.NullPointerException
│ at java.io.StringReader.(StringReader.java:50)
│ at shaded.org.json.JSONTokener.(JSONTokener.java:94)
│ at shaded.org.json.JSONArray.(JSONArray.java:162)
│ at io.shreyash.rush.ExtensionGenerator.main(ExtensionGenerator.java:50)
│ Picked up _JAVA_OPTIONS: -Xmx1024m

Make sure you:

  • are not creating (and building) your extension in the directory where you’ve unzipped rush-win64.zip,
  • have JDK version 8 or above installed, and
  • have JAVA_HOME path variable defined.

PS: Looking at the screenshot you posted, you seem to be creating an ad extension. Ad extensions are neither allowed nor they work in Kodular. You might get in trouble if found using and/or distributing them.

1 Like

ice_screenshot_20210404-201436

C:\Program Files\Java\jdk1.8.0_131\bin