I just clone new template and trying to cmd proguard but getting same error
Extension build successfully but not working on proguard cmd
[proguard] carry the GNU General Public License as well. Alternatively, you can
[proguard] apply for an exception with the author of ProGuard.
[proguard] Reading input...
[proguard] Reading program jar [C:\extension-template\build\externalComponents-classes\com.varsha.revealeffect.jar] (filtered)
[proguard] Reading library jar [C:\extension-template\lib\ant-contrib\ant-contrib-1.0b3.jar] (filtered)
[proguard] Reading library jar [C:\extension-template\lib\appinventor\AndroidRuntime.jar] (filtered)
[proguard] Reading library jar [C:\extension-template\lib\appinventor\AnnotationProcessors.jar] (filtered)
[proguard] Reading library jar [C:\extension-template\lib\appinventor\Barcode.jar] (filtered)
[proguard] Reading library jar [C:\extension-template\lib\appinventor\CommonVersion.jar] (filtered)
[proguard] Reading library jar [C:\extension-template\lib\appinventor\QRGenerator.jar] (filtered)
[proguard] Reading library jar [C:\extension-template\lib\appinventor\acra-4.4.0.jar] (filtered)
[proguard] Reading library jar [C:\extension-template\lib\appinventor\android.jar] (filtered)
[proguard] Reading library jar [C:\extension-template\lib\appinventor\androidsvg.jar] (filtered)
[proguard] Reading library jar [C:\extension-template\lib\appinventor\annotation.jar] (filtered)
[proguard] Reading library jar [C:\extension-template\lib\appinventor\apksigner.jar] (filtered)
BUILD FAILED
C:\extension-template\build.xml:86: The following error occurred while executing this line:
C:\extension-template\build.xml:101: The following error occurred while executing this line:
C:\extension-template\build.xml:178: Can't read [C:\extension-template\lib\appinventor\apksigner.jar] (only DEFLATED entries can have EXT descriptor)
Total time: 4 seconds
Picked up _JAVA_OPTIONS: -Xmx1024M
I have built an extension and tried to download a file to the ASD (app-specific dir). This works fine on devices with API < 29. But on devices with API > 28 I get this error:
I get the same error with the full path.
Here is my code:
Java
@SimpleFunction(description = "Downloads APK to AppSpecificDir (ASD): /storage/emulated/0/Android/data//files/. Note: No WRITE permission required.")
public void DownloadApkToASD(String url,String fileName){
String name = fileName;
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
request.setMimeType(URLConnection.getFileNameMap().getContentTypeFor(url));
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
int version_api = Build.VERSION.SDK_INT;
if (version_api > 28){
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS,name); //downloads to /storage/emulated/0/Download, not to the ASD (as it should)
}
else {
request.setDestinationInExternalPublicDir(context.getExternalFilesDir(null).toString().replace("/storage/emulated/0",""), name); // doesn't work for API > 28
}
DownloadManager dm = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
dm.enqueue(request);
}
Does anyone have any idea how to solve this?
I compiled it with the old Extension Template (without AndroidX): import android.support.v4.content.FileProvider;
today i tried to build aix with extension-template and
when i run ant extensions the result is BUILD SUCCESSFUL but when i try to run ant extensions -Dproguard=1 it show me the BUILD FAILED result.
And i want to ask i am using git, and when i want to build aix in extension-template i left click in extension-template folder and build using gitbash (I build my aix outside the src folder).
@ewpatton I see there seems to be a problem in the extension template because I have tried to build my aix many times with the command ant extensions -Dproguard=1 but the result is still BUILD FAILED
This is the source code I'm trying to build : SalmanTest.txt (1.7 KB)
And this is the build log result :
$ ant extensions -Dproguard=1
Buildfile: C:\Users\Salman\extension-template\build.xml
javac:
[javac] Compiling 1 source file to C:\Users\Salman\extension-template\build\classes
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] warning: In component SalmanTest, method ReturnText is missing a description.
[javac] Note: Wrote file file:/C:/Users/Salman/extension-template/build/classes/simple_components.json
[javac] warning: In component SalmanTest, method ReturnText is missing a description.
[javac] Note: Wrote file file:/C:/Users/Salman/extension-template/build/classes/simple_components.txt
[javac] Note: Wrote file file:/C:/Users/Salman/extension-template/build/classes/simple_components_build_info.json
[javac] warning: In component SalmanTest, method ReturnText is missing a description.
[javac] Note: Wrote file file:/C:/Users/Salman/extension-template/build/classes/AutogeneratedOdeMessages.java
[javac] Note: Wrote file file:/C:/Users/Salman/extension-template/build/classes/ComponentsTranslation.java
[javac] warning: In component SalmanTest, method ReturnText is missing a description.
[javac] 4 warnings
process:
[java]
[java] Extensions : Generating extensions
[java]
[java] Extensions : Generating files [com.SalmanDev.Test]
[java] Extensions : Copying file com\SalmanDev\Test\SalmanTest.class
[java] Extensions : Successfully created com.SalmanDev.Test build info file
[java] Extensions : Successfully created com.SalmanDev.Test extension properties file
unjarAllExtensionLibraries:
unjarExtensionLibraries:
unjarExtensionLibraries:
jarAllExtensions:
jarExtension:
[jar] Building jar: C:\Users\Salman\extension-template\build\externalComponents-classes\com.SalmanDev.Test.jar
ProGuard:
[proguard] ProGuard, version 6.2.2
[proguard] ProGuard is released under the GNU General Public License. You therefore
[proguard] must ensure that programs that link to it (net.sf.antcontrib.logic, ...)
[proguard] carry the GNU General Public License as well. Alternatively, you can
[proguard] apply for an exception with the author of ProGuard.
[proguard] Reading input...
[proguard] Reading program jar [C:\Users\Salman\extension-template\build\externalComponents-classes\com.SalmanDev.Test.jar] (filtered)
[proguard] Reading library jar [C:\Users\Salman\extension-template\lib\ant-contrib\ant-contrib-1.0b3.jar] (filtered)
[proguard] Reading library jar [C:\Users\Salman\extension-template\lib\appinventor\AndroidRuntime.jar] (filtered)
[proguard] Reading library jar [C:\Users\Salman\extension-template\lib\appinventor\AnnotationProcessors.jar] (filtered)
[proguard] Reading library jar [C:\Users\Salman\extension-template\lib\appinventor\Barcode.jar] (filtered)
[proguard] Reading library jar [C:\Users\Salman\extension-template\lib\appinventor\CommonVersion.jar] (filtered)
[proguard] Reading library jar [C:\Users\Salman\extension-template\lib\appinventor\QRGenerator.jar] (filtered)
[proguard] Reading library jar [C:\Users\Salman\extension-template\lib\appinventor\acra-4.4.0.jar] (filtered)
[proguard] Reading library jar [C:\Users\Salman\extension-template\lib\appinventor\android.jar] (filtered)
[proguard] Reading library jar [C:\Users\Salman\extension-template\lib\appinventor\androidsvg.jar] (filtered)
[proguard] Reading library jar [C:\Users\Salman\extension-template\lib\appinventor\annotation.jar] (filtered)
[proguard] Reading library jar [C:\Users\Salman\extension-template\lib\appinventor\apksigner.jar] (filtered)
BUILD FAILED
C:\Users\Salman\extension-template\build.xml:86: The following error occurred while executing this line:
C:\Users\Salman\extension-template\build.xml:101: The following error occurred while executing this line:
C:\Users\Salman\extension-template\build.xml:178: Can't read [C:\Users\Salman\extension-template\lib\appinventor\apksigner.jar] (only DEFLATED entries can have EXT descriptor)
Total time: 4 seconds
@ewpatton proguard worked after I added this line : <exclude name="*/apksigner.jar"/>
below this line : <exclude name="*/dx.jar"/>
Looks like you have to update your extension-template with that line
btw, why after I build aix with command ant ant extensions -Dproguard=1 it gives me 2 file,
and after i delete those two files and try to build with command ant extensions it gives me 1 aix.
and you see there is a file with the extension .map
is that not a problem?
The .map file is the mapping that proguard produces to map the obfuscated names back to their original names. If you don't include the -Dproguard=1, proguard won't be invoked so no mapping file will be produced. Both builds will yield the .aix file.
Yes, that's expected. You mainly need the .map file for interpreting stack traces from the app since otherwise they're unintelligible. For the most part you can probably ignore the map file. If you plan to release the extension to others, you may want to keep each one around (you'll have to save each .map file per build) so that you can respond to issues that come up in the obfuscated code.
i got errors: error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8) error: 447 bytes of body are still expected
the powershell:
input: PS E:\All> git clone --recurse-submodules https://github.com/mit-cml/extension-template.git test
output: Cloning into 'test'... remote: Enumerating objects: 97, done. remote: Counting objects: 100% (42/42), done. remote: Compressing objects: 100% (25/25), done. remote: Total 97 (delta 19), reused 38 (delta 17), pack-reused 55 (from 1) Receiving objects: 63% (62/97), 27.28 MiB | 538.00 KiB/s Receiving objects: 100% (97/97), 27.38 MiB | 495.00 KiB/s, done. Resolving deltas: 100% (33/33), done. Submodule 'lib/appinventor' (https://github.com/mit-cml/extension-deps.git) registered for path 'lib/appinventor' Cloning into 'E:/All/test/lib/appinventor'... remote: Enumerating objects: 181, done. remote: Counting objects: 100% (8/8), done. remote: Compressing objects: 100% (8/8), done. error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8) error: 447 bytes of body are still expected fetch-pack: unexpected disconnect while reading sideband packet fatal: early EOF fatal: fetch-pack: invalid index-pack output fatal: clone of 'https://github.com/mit-cml/extension-deps.git' into submodule path 'E:/All/test/lib/appinventor' failed Failed to clone 'lib/appinventor'. Retry scheduled Cloning into 'E:/All/test/lib/appinventor'... remote: Enumerating objects: 181, done. remote: Counting objects: 100% (8/8), done. remote: Compressing objects: 100% (8/8), done. error: 3281 bytes of body are still expected| 393.00 KiB/s fetch-pack: unexpected disconnect while reading sideband packet