I am now using the extension template to write an extension. But it needs external libraries to work. So I downloaded and placed those libraries into the respective directory. But when I try to compile my codes using ant, one library's method fails. After some investigation, that method seems require a minimum api level 23 to call it.
So, I would like to know what minimum api level is currently set in an AppInventor app? And could I change this minimum level so I can compile it successfully?
Thanks for the reply. Your answer seems solve the issue partially, but the compilation still fails. After further investigation, I think I've discovered a new problem.
The class that causes this problem is "NotificationCompat.Builder". I've found out actually there is an older version of it resides in the core.jar of App Inventor's internal library. I've downloaded a newer version that has the new method I would like to use. As the standard procedure, I use the @UsesLibraries annotation, but it seems my external library cannot override the internal library. So, does anyone know how to solve this?
Thank you for the suggestion. I removed the jar of the old version, but now the compiler simply told me couldn't find the classes:
[javac] D:\VSCodes_Projects\notification1Test-extension\src\com\extensions\Notification.java:6: error: package androidx.core.graphics.drawable does not exist
[javac] import androidx.core.graphics.drawable.IconCompat;
[javac] ^
[javac] D:\VSCodes_Projects\notification1Test-extension\src\com\extensions\Notification.java:26: error: package androidx.core.app does not exist
[javac] import androidx.core.app.NotificationCompat;
[javac] ^
[javac] D:\VSCodes_Projects\notification1Test-extension\src\com\extensions\Notification.java:27: error: package androidx.core.app does not exist
[javac] import androidx.core.app.NotificationManagerCompat;
[javac] ^
[javac] 3 errors
It seems not able to locate my new jar files. I am using the extension template from this place: https://github.com/mit-cml/extension-template . Are the procedures (such as the location of placing the external library files) not the same as building from the App Inventor source? For example, inside that template repository site, it tells me: " Any libraries you need should be placed under lib/deps/ ."
I removed the core.jar (this jar houses the androidx classes) and others inside the /lib/appinventor folder, and try to replace them with the my external libraries. But the compiler seems still can't find the external libraries, that's why those 3 errors occur.
By the way, is the following the correct way to add external libraries in the build.xml of the extension template?