Build fails when ZipAligning - exception

I have just installed Xamarin along with the plugin for Visual studio 2013 professional.
Now I have a problem when I open an Android project and I build it, it throws an error.
System.Exception: Build started.
C:\Program Files\Java\jdk1.6.0_39\\bin\jarsigner.exe -keystore "C:\Users\Asad Shafique\AppData\Local\Xamarin\Mono for Android\debug.keystore" -storepass android -keypass android -digestalg SHA1 -sigalg md5withRSA -signedjar bin\Debug\App6.App6-Signed-Unaligned.apk obj\Debug\android\bin\App6.App6.apk androiddebugkey
The specified task executable location "C:\Users\Asad Shafique\AppData\Local\Android\android-sdk\\tools\zipalign.exe" is invalid.
Build FAILED.
What would the problem be?

Go to your Android SDK folder C:\Users\Asad Shafique\AppData\Local\Android\android-sdk\build-tools\19.1.0 and copy "zipalign.exe" to C:\Users\Asad Shafique\AppData\Local\Android\android-sdk\tools.
Google has changed their paths in the latest SDK.
Xamarin forum discussion

Related

Why is Android Studio / Eclipse necessary to build an ANE?

I have used the following process to create a Java-based ANE for Android.
Compile the java files along with their dependencies for Android platform.
Create the .jar file with the Java SDK.
Create the .swc file.
Package the ANE using ADT.
When I use that ANE to package an APK, I get the following error:
dx tool failed:Compilation failed with an internal error. java.lang.IllegalArgumentException at com.android.tools.r8.org.objectweb.asm.ClassReader.<init>(ClassReader .java:160) at com.android.tools.r8.org.objectweb.asm.ClassReader.<init>(ClassReader .java:143) at com.android.tools.r8.org.objectweb.asm.ClassReader.<init>(ClassReader .java:418) at com.android.tools.r8.graph.JarClassFileReader.read(JarClassFileReader .java:91) at com.android.tools.r8.dex.ApplicationReader$ClassReader.lambda$readCla ssSources$1(ApplicationReader.java:231) at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(Unknown Source ) at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
I know I have not followed the conventional route of using the Android Studio or Eclipse, or some such IDE. I just used the command prompt to achieve building the ANE.
What am I missing here? Is there something specific that Android Studio does before it outputs a .jar file that is packaged into an ANE?
Changed the release flag in javac to --release 8 and the APK is correctly created. Earlier, the release flag was set to 16.

AndroidStudio Exception when starting android in a libgdx project

I get an exception when running the android gradle task in Android Studio 3.0.1. My project is build with libgdx. My desktop gradle task runs just perfect.
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':android:validateSigningDebug'.
where the root cause is
Caused by: java.lang.SecurityException: class "org.bouncycastle.jcajce.provider.symmetric.IDEA$Mappings"'s signer information does not match signer information of other classes in the same package
I have absoluty no idea how to fix this.
Mar Dev gave the right hint for me. I did:
cd ~/.android
keytool -genkey -v -keystore debug.keystore -alias androiddebugkey -keyalg RSA -keysize 2048 -validity 10000
keytool -importkeystore -srckeystore debug.keystore -destkeystore debug.keystore -deststoretype pkcs12
Then in AndroidStudio I followed the accepted answer of Where is debug.keystore in Android Studio

Houdini arm to x86 translation "Unsupported feature" error when using shared STL in Android NDK app

I created an Android Studio project from this sample NDK project provided by Google and changed a couple things so I could try to leverage Houdini arm to x86 translation:
In app/build.gradle I set abiFilters to armeabi-v7a.
In Application.mk I changed APP_ABI from all to armeabi-v7a so that x86 native libraries won't be created.
Also in Application.mk, I changed APP_STL from stlport_static to gnustl_shared.
You can see the modified code in this repo.
Then I ran the app in the BlueStacks emulator, which supports Houdini. I get the following error:
11-21 00:42:19.742 9947-9947/? D/houdini: [9947] Loading library(version: 4.0.8.45720 RELEASE)... successfully.
11-21 00:42:19.742 9947-9947/? D/houdini: [9947] Unsupported feature (ID:0x10600cae).
11-21 00:42:19.742 9947-9947/? D/houdini: [9947] Open Native Library /data/app-lib/com.sample.teapot-2/libTeapotNativeActivity.so failed.
...
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sample.teapot/com.sample.teapot.TeapotNativeActivity}: java.lang.IllegalArgumentException: Unable to load native library: /data/app-lib/com.sample.teapot-2/libTeapotNativeActivity.so
If I make APP_STL any of the supported values with shared I get this error, and with static it works fine. I'd like to get shared working, to solve this issue in React Native. Does shared STL not work with Houdini? Any workarounds?

Can you package an Adobe AIR app as UWP using Project Centennial?

I'm trying to complete a proof-of-concept, but I have hit a snag. With Adobe AIR able to support iOS and Android, I wanted to see if I could use the Project Centennial workflow to convert an Adobe AIR .exe installer, into a UWP app for x86 Windows 10.
I have been able to follow the directions for the latest version (0.1.24) and have been able to get the conversion started:
.\DesktopAppConverter.ps1 -Installer '..\AIR2UWP Example\AIR2UWP.exe'
-InstallerArguments "-silent" -Destination C:\ -PackageName "MyApp" -Version 0.0.0.1 -MakeAppx -Verbose -Publisher "CN=dougwinnie"
But when I use this, I get the following error:
C:\Users\dougw\Desktop\DesktopAppConverter_new\DesktopAppConverter.ps1
: DesktopAppConverter : error 'E_BAD_INSTALLER_EXIT_CODE': Installer
returned '10' when valid exit codes were '0' At line:1 char:1
+ .\DesktopAppConverter.ps1 -Installer '..\AIR2UWP Example\AIR2UWP.exe' ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,DesktopAppConverter.ps1
It seems that there is an installer error, but I can't seem to find any references to an AIR installer code 10 to help me troubleshoot further.
Thanks in advance...
It seems that there is an installer error, but I can't seem to find any references to an AIR installer code 10 to help me troubleshoot further
It’s up to the developer who owns the AIR platform to understand what is and is not a valid exit code for their setup technology(Adobe Air)
Can you package an Adobe AIR app as UWP using Project Centennial
Air apps might not be a good candidate as the Adobe air platform works and looks like ClickOnce. Specifically, the Air platform installs an auto-update service that provides an API for the Air app to check to see if updates are available. If you disable/remove that service, it’s very likely that no Air app will function as expected as the RPC call will likely fail.
In order to let Air apps works, we'd have to get Adobe to update the Air platform to be compatible with Centennial/UWP.

MonoDroid:INSTALL_FAILED_OLDER_SDK

Using MonoDroid 4.0.6 and MonoDevelop, any attempt to run in an emulator fails with this error listed below:
The minSdkVersion matches the emulator's SDK version. All AVDs were created by the MonoDroid isntaller.
Detecting package list location
Getting package list from device
Installing shared runtime package on device
1849 KB/s (25866362 bytes in 13.657s)
pkg: /data/local/tmp/Mono.Android.DebugRuntime-debug.apk
Success
Installing the platform framework
1565 KB/s (16530851 bytes in 10.310s)
pkg: /data/local/tmp/Mono.Android.Platform.apk
Failure [INSTALL_FAILED_OLDER_SDK]
Failed to install the platform framework
I solved this in 2 ways.
1) In the manifest the minSdkVersion should match or be lower than the emulator
2) (what tripped me up) The Mono DLLs References of the project should be set to the Android version too.
Both are needed. I come from a Java Android background so never thought to change anything but the manifest.