Fabi An
Fabi An

Reputation: 1

Failed to seal APK, Visual Studio won't build apk

Hei guys,

while trying to build an signed apk in my visual studio i ran in some errors:

BUILD FAILED

Total time: 2.284 secs

1>MSBUILD : cordova-build error : FAILURE: Build failed with an exception.
1>MSBUILD : cordova-build error : * What went wrong:
1>MSBUILD : cordova-build error : Execution failed for task ':packageRelease'.
1>MSBUILD : cordova-build error : > Failed to seal APK
1>MSBUILD : cordova-build error : * Try:
1>MSBUILD : cordova-build error : Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Command finished with error code 1: cmd /s /c ""C:\Users\poehler\Documents\Visual Studio 2017\Projects\DividendenApp\DividendenApp\platforms\android\gradlew.bat" cdvBuildRelease -b "C:\Users\poehler\Documents\Visual Studio 2017\Projects\DividendenApp\DividendenApp\platforms\android\build.gradle" -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
1>MSBUILD : cordova-build error : Error: cmd: Command failed with exit code 1 Error output:
1>MSBUILD : cordova-build error : FAILURE: Build failed with an exception.


1>MSBUILD : cordova-build error : * What went wrong:
1>MSBUILD : cordova-build error : Execution failed for task ':packageRelease'.
1>MSBUILD : cordova-build error : > Failed to seal APK
1>MSBUILD : cordova-build error : * Try:
1>MSBUILD : cordova-build error : Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
1>MSBUILD : cordova-build error : Picked up _JAVA_OPTIONS: -Xmx512M

I created my keystore file like descriped in here: http://taco.visualstudio.com/en-us/docs/tutorial-package-publish-readme/

And i also edited my build.json like so:

{
     "android": {
        "release": {
            "alias": "myname",
            "keystore": "C:\\mykey.keystore",
            "keystoreType": "",
            "password": "key",
            "storePassword": "key"
        }
     }
 }

My ant.properties look like this:

key.store=C:\\mykey.keystore
key.alias=myname
key.store.password=key
key.alias.password=key

Do you guys have any suggestions?

Upvotes: 0

Views: 466

Answers (2)

M.Raveed Riaz
M.Raveed Riaz

Reputation: 31

I found the solution you just have to increase the key size 2048 to 4096

keytool -genkey -v -keystore c:\my-release-key.keystore -alias ABC -keyalg RSA -keysize 4096 -validity 100000

Upvotes: 3

Fabi An
Fabi An

Reputation: 1

so I found an workaround with this issue.

Just go to the cordova directory and type

cordova build -release android

this one worked for me.

Upvotes: -1

Related Questions