This is the repository that demonstrates this issue.
This is simple standard project with one page. I created the archive for publishing (release mode).
If I use the "AOT compile" option, I get the error:
"Apk failed to install Error:could not parse error string"
If I disable this option, then the APK works.
To use my test project, update the option AndroidSigningKeyStore in ApkSignerIssue.Android.csproj to point to file test.keystore in the folder test.
I'm on Windows 10 and I'm using Android Api 26. If I try Api 25, it does not work. I've tried using VS 15.5.7 and 15.8.0(preview) with "AOT compile" and neither of those work.
Without this option, XF+Android can not be used; the first load of the app will take 8-10 seconds.
It worked earlier, but now I can not build a package to release an update to my application.
Downgrade to 15.5.7 working for me now.
I do not know why this did not work right away, maybe I rebooted the computer. but now it works.
That's good - I was able to release an update my app.
And this is very sad - this is my fourth Downgrade in three months(starting from 15.6).
Archiving the package does not work normally three months, three months, Karl!
I lost a lot of time.
Related
I know how to enable MultiDex support, but my problem is the opposite.
Seems like my Android Studio's MultiDex option is enabled by default for some reason.
When I unziped the resulting APK file and checked inside, there were two files.
classes.dex and classes2.dex.
You may say my project may hit 64K limit, but no, it doesn't.
I also tried without any dependencies and with some other gradle settings,
but the result was all the same.
I even put the line multiDexEnabled false, but it didn't help either.
So this time I created another new empty project, and hit the Run button without any modification.
Result? Same.
As you can see, I have two .dex files with very low references.
I don't understand what's happening here..
The reason why I'm trying to disable MultiDex is,
First, my app is really simple with a few dependencies so just don't need it.
Second, the app needs to support even older Android OS.
Third, I want to avoid the Dalvik linearAlloc limitation in the old Android devices.
Finally, I want to know the exact cause of this.
One more fun fact.
I decompiled and looked into the the apk file, and couldn't find the class named MainActivity which was created by default while the app ran on my phone as expected.
The same is true for my real project. The app works well but there isn't my code in the classes*.dex. Yeah, it's fine if the app works without any problem, but it's somewhat annoying because I sometimes want to decompile and see the resulted code.
Things like Instant Run change the nature of the APK. What you get when you run the app from the IDE is different than what you get when you build the app by other means (Build APK(s) in the menu, gradle tasks, etc.).
This is one of the reason why I disable Instant Run, as I'm one of those crazy people who wants to run the same app that my users would run.
Android Studio 3.0 makes another change to the APK, compared to what your users will run: it adds android:testOnly="true", preventing that APK from being installed normally. Probably this is a safety measure, so that you only distribute APKs made through some other build mechanism.
In your case, based on the comments, it appears that Instant Run was what was causing the multidex-style behavior. That may be tied to how Instant Run attempts to patch an already-installed APK, rather than push the fresh APK to the device or emulator.
So, either disable Instant Run or don't analyze the Run output, but instead focus on APKs built by other means.
OK, please take it easy on me, I am new to the whole Xamarin community. I have built a simple calculator app using MVVMCross. When I run the app in an emulator everything works great. It still needs some UI attention, but functionally it all works. When I go to archive it and make an install on my phone, it installs just fine. The issue is when I go to run it. As soon as it opens I get an error message. "Calculator.UI.Droid has stopped" Open app again. I have gone through everything I can find online to do this and nothing is working.
Here is my setup:
Visual Studio 2017 Community with latest updates
Windows 10 with latest updates
Latest Java SDK
Project Properties:
Compile using Android Version 7.1 (Nougat)
Minimum Android Version 5.0
Target Android Version 7.1
Use Fast Deployment - false
Generate one package (.apk) per selected ABI - unchecked
Enable ProGuard - checked
Linking - SDK and User Assemblies
Android Phone:
Google Pixel 2 with latest updates.
Any help would be appreciative. Just let me know if you need more information. Thanks in advance
I myself are also using Xamarin, and quite often I get this problem, most times it is related to the code, so please make sure that's the case.
comment out your calculator stuff, and try running the basic app on your physical device. if that works try to find the problem, idk if you can use breakpoints because your problems happens on boot.
I'm trying to build an empty HaxePunk project for Android to test the build chain, and while I'm never getting any error, all my attemps have crashed at run time with the same error message :
Error: dlopen failed: cannot locate symbol "stpcpy" referenced by libzlib.so...
I am running the executable on a pretty old phone with Android 4.3 on it ; a Sony Xperia M.
I have been doing a bit of research, and so far I mostly see the same things being repeated : update your NDK (I've been using the latest one from the android dev website and not the one lime setup android downloads), build for previous API versions (which I am also doing with <config:android target-sdk-version="18" /> in my project.xml file). So I don't know what I'm doing wrong, if anything.
Another thing I found is that I'm using the git version of HXCPP, and when I built the Android libs with neko build.n android in the project subdir, it was using -DHXCPP_ANDROID_PLATFORM=26 whereas the Lime build of my project is using -DHXCPP_ANDROID_PLATFORM=9, so that can't be good. However, I don't really know much about Android at all, but I have read that the SDK version and Android platform are two different things, or so I've read.
Any help with this will be much appreciated.
EDIT : Okay so something weird happened : up until now I was trying to install the APK manually by copying it to my phone's files and launching it from there, which kept crashing. I tried lime test android once without changing anything at all and it worked fine, and from then I could manually install the APK like I used to, and the error never happened again. I can't replicate it, but it's still an open case.
I'm very close to giving up with Android development. I don't currently have an Android phone so I'm trying to use emulators. In Eclipse, after fixing 500000 bugs/errors I finally managed to get an emulator to launch - but it kept getting stuck on the Android loading screen (even after like 45 mins) so somebody recommended me to use Android Studio.
I downloaded this on my PC, and when I tried to run a blank activity I got this error:
When I tried to actually play around with the activity, I got a rendering error:
I saw some stuff online that said to use a downgraded Android version for the error to go away - however, I only have 2 versions as you can see and none of them are working.
I tried downloading/installing Android Studio on my laptop too and got the exact same problems. What is going on? I have spent 2 days trying to run a blank activity now and am really on the verge of just giving up. Any ideas?
EDIT: Trying out Jorge Casariego's suggestion but cannot find Open Modules when I right click
Looks like it happens because you are updated Android build tools to "24.0.0 rc1" but not update gradle build plugin to 1.3.0-beta1 version.
Make sure that you have in yourProjectFolder/build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0-beta1' // or 1.2.3
}
And in yourProjectFolder/mainModuleName/build.gradle you have
android {
...
buildToolsVersion "24.0.0 rc1" // or 23.0.1
...
}
or as a variant use last stable versions of build tools
To downgrade your SDK, you need to download a different SDK version. To do this, you need to run the SDK Manager which is the 4th image from the right:
This will allow you to download different versions of Android, allowing you to get API 19/20/21, which should fix your issue.
I get this rendering problem all the time and I've been developing for almost 2 years now, with over 10 months on android studio. These rendering problems are only for the activity preview, which usually isn't very helpful at all anyway. If you don't have an Android device, my best suggestion would be to download the GenyMotion emulator. It is 1000x better than the built in emulator, and even has a plugin for android studio that allows you to run it from within the IDE. If you need to check how a layout works, I would recommend just running the app in the emulator, as you will get a much better idea of how things look anyway, rather than trying to approximate it with the layout previewer.
Edited 6/10/18:
The packaged emulator has been updated extensively and now performs much better. For that reason, I've removed the link to the 3rd party tool. I realize my intention at the time was to be helpful, but having a link to a 3rd party tool in a stackoverflow question seems inappropriate, especially given the reason for highlighting it is outdated.
To resolve this issue follow the following steps :
Go to your app folder under Navigation section.
Right Click -> Open Module Settings
Set Compile with SDK Version as API 22 or below (Lollipop)
Set Build version as 21.1.2
Clean + Build your Project
to use the new M preview, you'll need to also use Android Studio 1.3 Preview (from the canary channel).
I have this problem too. Because I named my App the wrong thing. It has a "-" character in the app name. Ex: Web-ViewDemo. It causes a wrong location, so android studio can't do anything totally right 100%.
In short, try to rename your app!
I'm trying to run an application using the latest Google Play Services (5.0.89 at the moment) on the android emulator, but every time I open it, I get the notification asking me to update G.P.S. I'm using a "Google API L18" AVD. And this is quite annoying if you're trying to run some espresso tests.
Apparently, it's a common problem that keeps plaguing android developers: https://code.google.com/p/android/issues/detail?id=57880
So far I've tried:
just clicking ok -> but then I'm not connected to the services, which is bad
switching to the Android L Preview AVD -> same problem
downloading the G.P.S. apk from somewhere and trying to install it. Fails, since it's already present (and cannot be uninstalled)
creating and AVD without G.P.S. and installing them manually. I get a "device not supported" error
installing just a few packages (like this "adb -e install com.google.android.gms.apk) -> but I cannot find them for the 5.0.89 version
in my application code, ignore the error returned by GooglePlayServicesUtil.isGooglePlayServicesAvailable -> the connection still fails (which means that simply not checking is not an option)
UPDATE Trying to edit the value of GooglePlayServicesUtil.GOOGLE_PLAY_SERVICES_VERSION_CODE through reflection -> didnt't work (btw, yes I know it's an horrible hack, at this point it was more curiosity than anything else)
So, did anyone find a solution for this?
So far, the only option I can come up with to make it work is to delete my local copy of G.P.S. from the SDK tools, replace it with a previous version downloaded from somewhere (I haven't looked for it yet, but I'm pretty sure I'll be able to find some shady site providing it) and then rebuild my app. But this isn't something I'd like to do.
If you go to the SDK Manager and check for updates, there should be an update for the API 19 system images. Have you tried updating to those and recreating the emulator and seeing if the problem persists?