Extension Template Repository

I've pushed another commit that should fix this. You will still need to include the lib in @UsesLibraries.

1 Like

Is there any news about this?

1 Like

Will this project continue at some point?

@Anke I’ve updated the repo to fix the bug in question. As we make further changes to the extension system I’m willing to update it. I think the only thing outstanding at this point is porting the Proguard functionality that @Diego implemented in the main repo. Is there something in particular missing that you need?

3 Likes

Thanks, I didn’t notice that change / last fix.

I tried to follow a suggestion from @vishwas to simplify my first extension My first extension - quadratic equation

this way:

public YailList Calc(float a, float b, float c) {
  float x1 = /*YOUR CODE TO FIND THE FIRST SOLUTION*/;
  float x2 = /*YOUR CODE TO FIND THE SECOND SOLUTION*/;
  return YailList.makeList(new Object[] {x1, x2});
}

but unfortunately that fails:

I got this PM from @vishwas
It looks like you cannot use the gnu.lists.Pair module in the template repository. The YailList module uses Pair to make the list, hence the build failed when you added the list to your code. Evan might have a better idea as to why this is happening as he’s the author of the template repository.

(I just tried making the extension using the full AI sources, and it works​:thinking:)

Is there any solution for that?

I added kawa-1.10.jar, which contains gnu-lists.Pair from the App Inventor sources to the libraries and in the build.xml to solve that issue

2 Likes

But where exactly does that (kawa-1.11-modified.jar ?) have to be placed?

grafik

and here:

@Anke place in

lib/deps/kawa-1.11-modified.jar

and dont forget import and add anotation library..

import com.google.appinventor.components.annotations.UsesLibraries;
and
@UsesLibraries(libraries = "kawa-1.11-modified.jar")

1 Like

This is not necessary for me. See modifications in

import com.google.appinventor.components.runtime.util.YailList should do it

2 Likes

I’ve updated the template to include the version of Kawa from appinventor-sources. That should fix the issue.

7 Likes

I tried to import this:

import android.support.v4.content.FileProvider;

and get this error:

I didn't pull in all of the android-support libraries from App Inventor, but if you also have the appinventor-sources checked out you can copy them from lib/android/support/ so everything is available to your extension.

1 Like

Because the support libraries are baked into every app, doing this will cause dx to fail compilation due to duplicate classes since it will come once from the buildserver and once from the extension.

2 Likes

Thanks, I deleted my post as to not create confusion/issues.

1 Like

No worries. Adding the library is usually the right behavior. I don't know why Android/Google chose not to handle copies of the exact same class during compilation, but it causes many headaches.

3 Likes

Thank you, successfully done.

@ewpatton Can you please update the Extension Template Respository (→ AndroidX).

I got this error:

1 Like

Just replace android lib with androidx lib.

1 Like

That's not the only thing that needs to be changed. In fact the android.jar present in lib directory is very different from AndroidX, and there exists no such thing as a single AndroidX library. It is a collection of different libraries, altogether known as AndroidX libraries.

In addition to that, there were quite a lot changes done in nb184 release, so, other files needs to be updated as well to reflect these changes.

1 Like