I am trying to compile my extension with Rush so that I can put ads in my app but the build failed.
I don't know where the problem is but I am going to post a picture.
The top arrow points to the line that I was instructed to add in this guide. How can I add admob extension to my app?
I do not know if the line is correct. For example, the star at the end of the line.
Furthermore, I don't know if the @UserPermissions line and the @UsesApplicationMetadata line are in the correct place.
Here's the text from this picture. (my .java file that was created when I ran
rush create <projectname>
package io.htwgadsext;
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;
import com.google.appinventor.components.annotations.androidmanifest.*;public class Htwgadsext extends AndroidNonvisibleComponent {
public Htwgadsext(ComponentContainer container) {
super(container.$form());
}@UsesPermissions(permissionNames = "")
@UsesApplicationMetadata(metaDataElements={@MetaDataElement(name="com.google.android.gms.ads.APPLICATION_ID", value="App-ID-Number")})@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;}
}
Here is the contents of the rush.yml file.
# For a detailed info on this file and supported fields, check out the below link:
# https://github.com/ShreyashSaitwal/rush-cli/wiki/Metadata-File
---
name: NameName
description: Extension component for PackageName. Created using Rush.
version:
number: auto
name: '1'
authors:
- BlahBlah
build:
release:
# Optimizes the extension on every release build.
optimize: true
# If enabled, you will be able to use Java 8 language features in your extension.
desugar:
enable: false
desugar_deps: false
assets:
# Extension icon. This can be a URL or a local image in 'assets' folder.
icon: icon.png
# Extension assets.
# other:
# - my_awesome_asset.anything
# Extension dependencies (JAR).
# deps:
# - my_awesome_library.jar
Here is the xml file's contents.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="io.Package">
<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>
</manifest>
Thanks for any help!

