How to get path of the assets in the extension aix file

Hi there,
I attached one html file in the aix, and tried to get the path of the assets in the aix like this:
-55301525392a4b1c
this works in companion, but not work after complied to apk.
what to do to get the right path?
thanks
Kevin

Did you include the assets in the @UsesAssets annotation on the component? Otherwise, they will be dropped by the build server.

2 Likes

Thank you sir for your reply.

I found the reason is that I used a third party aix compiler, and it packed the aix in a wrong way.

Have notified the author of the compiler to fix it, and now the aix works fine.

anyway, this compiler is light weighted, easy to use, quick to compile. you can find it here

Kevin

2 Likes

maybe tell how to use it??

How to use AIXC

  1. download aixc.zip https://gitee.com/Zhangzqs/AIX-Compiler/attach_files/379593/download/aixc.zip

  2. unzip this aixc.zip to your computer,

  3. orgnize your aix project like this:
    2021-05-16_193002

  4. run below command

example :

or, you can simply drag and drop the project folder on aixc.bat. then you can find your extension in /build/outputs/

  1. this aixc have the android.jar and appinventor-runtime.jar, you can set up the build path to /aixc/runtime-library to use this packages. NO NEED TO DOWNLOAD MIT APP INVENTOR SOURCE CODE.
    This is what I did:
    2021-05-16_193802

now i see thanks for explanation and it only works with command prompt and not with powershell and git bash

also pls see this -

C:\Users\91942\Downloads\aixc>aixc AIX-Compiler
Picked up _JAVA_OPTIONS: -Xmx2048M

I:[18:51:22]:??????????

I:[18:51:22]:?????C:\Users\91942\Downloads\aixc\AIX-Compiler\build

I:[18:51:22]:????Java??

I:[18:51:22]:??AppInventor????????C:\Users\91942\Downloads\aixc\runtime-library

I:[18:51:22]:ECJ??????? -classpath C:\Users\91942\Downloads\aixc\runtime-library\appinventor-runtime.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\drawerlayout-28.0.0.jar;C:\Users\91942\Downloads\aixc\AIX-Compiler\libs\dx.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\support-annotations-28.0.0.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\livedata-core-1.1.1.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\animated-vector-drawable-28.0.0.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\support-fragment-28.0.0.jar;C:\Users\91942\Downloads\aixc\runtime-library;C:\Users\91942\Downloads\aixc\runtime-library\support\support-vector-drawable-28.0.0.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\viewpager-28.0.0.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\viewmodel-1.1.1.jar;C:\Users\91942\Downloads\aixc\AIX-Compiler\libs;C:\Users\91942\Downloads\aixc\AIX-Compiler\libs\proguard.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\localbroadcastmanager-28.0.0.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\appcompat-v7-28.0.0.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\livedata-1.1.1.jar;C:\Users\91942\Downloads\aixc\AIX-Compiler\libs\json.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\testing-support-R-classes.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\versionedparcelable-28.0.0.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\asynclayoutinflater-28.0.0.jar;C:\Users\91942\Downloads\aixc\runtime-library\android.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\swiperefreshlayout-28.0.0.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\coordinatorlayout-28.0.0.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\slidingpanelayout-28.0.0.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\lifecycle-common-1.1.1.jar;C:\Users\91942\Downloads\aixc\AIX-Compiler\libs\d8.jar;C:\Users\91942\Downloads\aixc\AIX-Compiler\libs\gson-2.1.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\customview-28.0.0.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\runtime-1.1.1.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\loader-28.0.0.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\common-1.1.1.jar;C:\Users\91942\Downloads\aixc\AIX-Compiler\libs\ecj-4.5.1.jar;C:\Users\91942\Downloads\aixc\runtime-library\appinventor-runtime-source.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\interpolator-28.0.0.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\support-core-ui-28.0.0.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\collections-28.0.0.jar;C:\Users\91942\Downloads\aixc\AIX-Compiler\libs\javassist.jar;C:\Users\91942\Downloads\aixc\runtime-library\kawa-1.11-modified.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\cursoradapter-28.0.0.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\constraint-layout-1.1.3.jar;C:\Users\91942\Downloads\aixc\AIX-Compiler\libs\jsoup-1.12.1.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\support-core-utils-28.0.0.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\support-compat-28.0.0.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\print-28.0.0.jar;C:\Users\91942\Downloads\aixc\AIX-Compiler\libs\zip4j-2.2.3.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\constraint-layout-solver-1.1.3.jar;C:\Users\91942\Downloads\aixc\runtime-library\support\documentfile-28.0.0.jar -source 1.8 -target 1.8 -parameters -g -encoding utf-8 -d C:\Users\91942\Downloads\aixc\AIX-Compiler\build\classes C:\Users\91942\Downloads\aixc\AIX-Compiler\src
----------
1. WARNING in C:\Users\91942\Downloads\aixc\AIX-Compiler\src\cn\zzq\aix\builder\blocks\BlockUtil.java (at line 7)
        import javax.lang.model.type.TypeMirror;
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The import javax.lang.model.type.TypeMirror is never used
----------
----------
2. WARNING in C:\Users\91942\Downloads\aixc\AIX-Compiler\src\cn\zzq\aix\builder\buildinfo\ComponentBuildInfo.java (at line 8)
        import com.google.appinventor.components.annotations.SimpleBroadcastReceiver;
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The type SimpleBroadcastReceiver is deprecated
----------
3. WARNING in C:\Users\91942\Downloads\aixc\AIX-Compiler\src\cn\zzq\aix\builder\buildinfo\ComponentBuildInfo.java (at line 187)
        @SuppressWarnings({ "deprecation" })
                            ^^^^^^^^^^^^^
Unnecessary @SuppressWarnings("deprecation")
----------
4. WARNING in C:\Users\91942\Downloads\aixc\AIX-Compiler\src\cn\zzq\aix\builder\buildinfo\ComponentBuildInfo.java (at line 210)
        for (String xmlFileName : usesXMLActivities.fileNames().trim()
                    ^^^^^^^^^^^
The value of the local variable xmlFileName is not used
----------
----------
5. WARNING in C:\Users\91942\Downloads\aixc\AIX-Compiler\src\cn\zzq\aix\builder\compiler\Compiler.java (at line 7)
        import cn.zzq.aix.builder.utils.CommandBuilder;
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The import cn.zzq.aix.builder.utils.CommandBuilder is never used
----------
----------
6. WARNING in C:\Users\91942\Downloads\aixc\AIX-Compiler\src\cn\zzq\aix\builder\compiler\GroovyCompiler.java (at line 63)
        private String buildSaveParmsNameCommand() {
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
The method buildSaveParmsNameCommand() from the type GroovyCompiler is never used locally
----------
7. WARNING in C:\Users\91942\Downloads\aixc\AIX-Compiler\src\cn\zzq\aix\builder\compiler\GroovyCompiler.java (at line 96)
        String[] argv=command.split(" ");
                 ^^^^
The value of the local variable argv is not used
----------
----------
8. ERROR in C:\Users\91942\Downloads\aixc\AIX-Compiler\src\cn\zzq\aix\builder\compiler\KotlinCompiler.java (at line 73)
        org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.main(command.buildCommandArray());
        ^^^^^^^^^^^^^
org.jetbrains cannot be resolved
----------
----------
9. ERROR in C:\Users\91942\Downloads\aixc\AIX-Compiler\src\cn\zzq\aix\builder\utils\CommandBuilder.java (at line 6)
        import com.google.common.collect.Lists;
               ^^^^^^^^^^^^^^^^^
The import com.google.common cannot be resolved
----------
10. ERROR in C:\Users\91942\Downloads\aixc\AIX-Compiler\src\cn\zzq\aix\builder\utils\CommandBuilder.java (at line 9)
        private ArrayList<String> commands = Lists.newArrayList();
                                             ^^^^^
Lists cannot be resolved
----------
----------
11. WARNING in C:\Users\91942\Downloads\aixc\AIX-Compiler\src\com\google\appinventor\components\runtime\collect\Lists.java (at line 52)
        public static <E> ArrayList<E> newArrayList(E... elements) {
                                                         ^^^^^^^^
Type safety: Potential heap pollution via varargs parameter elements
----------
----------
12. WARNING in C:\Users\91942\Downloads\aixc\AIX-Compiler\src\com\google\appinventor\components\runtime\collect\Sets.java (at line 10)
        import java.util.EnumSet;
               ^^^^^^^^^^^^^^^^^
The import java.util.EnumSet is never used
----------
13. WARNING in C:\Users\91942\Downloads\aixc\AIX-Compiler\src\com\google\appinventor\components\runtime\collect\Sets.java (at line 57)
        public static <E> HashSet<E> newHashSet(E... elements) {
                                                     ^^^^^^^^
Type safety: Potential heap pollution via varargs parameter elements
----------
14. WARNING in C:\Users\91942\Downloads\aixc\AIX-Compiler\src\com\google\appinventor\components\runtime\collect\Sets.java (at line 71)
        public static <E> SortedSet<E> newSortedSet(E... elements) {
                                                         ^^^^^^^^
Type safety: Potential heap pollution via varargs parameter elements
----------
14 problems (3 errors, 11 warnings)

I:[18:51:23]:????AndroidRuntime.jar

I:[18:51:23]:???????aix???

I:[18:51:23]:??????????

I:[18:51:23]:??????????0????
Exception in thread "main" java.lang.NullPointerException
        at cn.zzq.aix.builder.utils.Path.toPathArray(Path.java:259)
        at cn.zzq.aix.builder.utils.Path.listChildren(Path.java:76)
        at cn.zzq.aix.builder.project.AIXProject.packAIX(AIXProject.java:153)
        at cn.zzq.aix.builder.AIXBuilder.compileProcessor(AIXBuilder.java:186)
        at cn.zzq.aix.builder.AIXBuilder.main(AIXBuilder.java:74)

after that no aix comes

wait when i removed the cn and com folder and created my own it worked thanks

So now it working?

1 Like

I think it is something similar to Extension Template.

don"t know.
did not use extension template before.

ps. any mod better to seperate this to a new thread

There are some similarities.
So I asked just to clarify.