Extension Template Repository

It seems not to be working. I’m getting package XYZ does not exist error.

That’s my fault as I included the deps in the extension steps but not in the javac step. I pushed a patch that should fix it.

1 Like

Hi @ewpatton,
This commit still doesn’t solve the issue. The libs aren’t getting added to the AndroidRuntime.jar file. I’m not sure but, maybe this is caused due to the build system treating the external libs as core-libs (like android.jar, etc.) and hence, not including them in AndroidRuntime.jar.

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.

6 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.

2 Likes

Thank you, successfully done.