I was testing the new version of Ionic framework with Capacitor as I tried to build and run my app on emulator and my device I faced this error without success in installing app
No Compatible APKs found for the device.
after lots of search and struggling to fix this and lots of fails, as I was talking to one of my friends about it I realised maybe this is related to build configuration.
as I could not find similar anywhere I decided to share the answer here maybe helps and save someone time.
No Compatible APKs found for the device.
This error appears to your Build Output when android studio cannot find the related APK file generated, so by a simple change in your buid configuration you can fix this, in my case I fixed the problem like this:
thorugh this section select:
Edit Configuration
default Deploy option under Installation option is set to
APK from app bundle
by changing it to
Default APK
you'll be able to build and run your app successfully.
I hope it help you to run your shiny app asap ;p
Related
After I've updated android project gradle version to 3.0.0 I've faced weird issue. When I'm trying to install my app with Fabric or send *.apk via email it says "App cant be installed" but when I work directly with IDE everything is fine.
I've already spent a lots of hours browsing all known gradle 3.0.0 issues, but didn found anything.
Maybe anybody faced similar issue?
P.S. sorry, there is no match code to share, because I think its not related on configurations, cause it works via Android Studio.
Maybe anybody faced similar issue?
Yes, and I blogged about it a couple of days ago.
If you are going to distribute the APK, build the APK explicitly for that role, such as:
Using the “Build APK(s)” menu option
Using the assembleDebug or assembleRelease Gradle tasks
The APK from an IDE build now has FLAG_TEST_ONLY set, and such an APK cannot be installed normally. adb install -t will install it, but that would require the recipient to have the Android SDK.
Adding to CommonsWare answer, there is one more issue.
You might enabled Instant Run. One major drawback of this feature is, you can not use apk for other device (other than the device which you are using for development).
If so, after disabling this feature you will be able to use created apk (debug apk) to other device also (by using unknown sources option or adb option)
I was always able to build from this project, this just started happening this morning. When I run ionic build android everything runs smoothly and the build succeeds, but the date modified on the android-debug.apk file stays the same, and I don't see my changes when I run it on a device.
Could it have something to do with messed up permissions and somehow it doesn't have permission to write the apk? I'm running Ubuntu-server 14.04.4.
I know it's been answered before but I'm adding this to let you guys know what I've tried and how it's not working anyways...
I've also faced same issue and tried several things like
Renaming APK file, expecting it will create new one.
Deleting build folder, expecting as usual will create new one.
opening project in Android studio, expecting it will create new one when I use it to launch the APK to device.
I've tried calling ionic prepare platform before calling ionic build.
The ionic build is a proxy for cordova build command.
But in this issue all of above approaches were failed.
The reason I can see behind this is because of no proper response/function of added platform to your project, as when you build it's cordova platform android's responsibility to prepare build on your command. Which is not working.
Lot of people suggests that You need to us ionic/cordova restore, this will restore your state.
Another way is you can use Android Studio's build APK option which helps you not to disturb your plugins by restore or reset commands.
Hope this helps you save your time from trying all these approaches.
Could it that you are looking at a wrong place?
When build command is successfully finished you should see smth like below in console
Built the following apk(s):
<PATH_TO_YOUR_SOURCES>/platforms/android/build/outputs/apk/android-debug.apk
Are you checking this this location?
Okay so the problem isn't with Ionic, it's just that the changed files aren't showing up in the ftp for some reason. So now I will try and figure that out.
As suggested by #mobileevangelist , ionic cordova restore can be done using command
ionic cordova prepare
It fixed my problem.
Try to
Open Android Studio
Choose Import project
Select YourProjectDirectory/platforms/android folder
Choose Build -> Build APK
So I have just started my first app in which I have a button and when user clicks on it then it just print the message.
But when I build the app and when I run that app on android studio's console then after opening it crashes and then it stops working.
Meanwhile I have searched for the error and they suggested me to see logcat table or the text file in which I can easily see the errors but after it I am stuck because I have no idea that how can I solve such problem.
Please help me with it.
Not sure how capable you are with android and you haven't given us much info to work with.
could you post a brief description of the logcat from launching the apk to the apk actually crashing?
the logcat is gonna be the best option to diagnose it.
Are you using the android sdk and emulator?
Have you updated the resources and api's?
If you go into the resource list there should a online repo with a whole lot more SDK bits you might find help.
What api's and android version is your apk built from and is your emulator emulating the same android build?
Could be the apks GUI resolution or script related, have you checked through it all?
Microsoft visual studios has a very good debug system and trouble shoot but I'm not sure if android is compatible as I've only used wp8 on it. Worth finding out though.
This may be a silly question but here it goes:
I'm developing my first app with phonegap, and currently targeting android only. But this is the second time I face this problems, in my project folder, through CLI I run cordova build android, the apks were not generated.
After a LONG time debugging, and undoing my recent changes. I finally tried to compile it in Eclipse, to check if it was an android compilation error, just to find out that I have copied some test images, and the names got something copy (1).png, and android don't allow that name...
So, How do I check, from command line, the logs/errors generated by phonegap/cordova buid?
You can run the CLI in debug mode with the -d option.
cordova -d build android
This way you will get a lot more detailed report.
I'm sure you have this figured by now but just in case you, or anyone else still needs help, you may be encountering this issue because of your antivirus. I had a similar issue where when I tried to build my application. Though there were no errors being given, it was not building any APK's.
The fix for me in this situation was by temporarily disabling "Auto-Sandbox" in Comodo, (the antivirus I was using).
Hopefully this helps anyone having the same issue.
I am working with ccr4j API in Android so when I run my project its thrown an error like:
Error while installing application (INSTALL_FAILED_DEXOPT)
I find from net and same site also, did all trying like,
1. Uninstalled same application from device.
2. Run Emulator with Wipe User Data.
But still same error comes.
So anyone know why its thrown this kind of error?
This most likely has to do with the size of classes.dex. On anything pre-ICS dexopt will fail on anything over 5mb. Check the size of classes.dex in your apk. It would also be good to see what your method count is as dex has a 65536 method/field limit.
I have same problem. Checked classes.dex file and it is about 7mb's. I'll try to find a solution. I hope Facebook's solution solves mine too.
By the way thanks for information #Jared.
https://www.facebook.com/notes/facebook-engineering/under-the-hood-dalvik-patch-for-facebook-for-android/10151345597798920
Edit 1: I've solved this problem by using proguard optimization. My previous classes.dex file was about 7mb, and after proguard optimization it became 4mb. And now I can run this obfuscated and optimized apk on 2.2 and 2.3 devices.
Edit 2: Official Google Multi Dex support is the best solution for this issue. https://developer.android.com/tools/building/multidex.html
Find Android SDK folder. (Usually C:\User\AppData\Local\Android\sdk) Delete folders which starts with dot(.), they are temporary downloads files. Then delete Android Emulator from SDK Manager. Then run Android Studio as administrator and then download and install Android Emulator again. And make sure you have installed Intel H.A.X.M.. Now you can create emulator and use it without errors.