Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No apk found #598

Closed
srobinet opened this issue Feb 21, 2019 · 11 comments
Closed

No apk found #598

srobinet opened this issue Feb 21, 2019 · 11 comments

Comments

@srobinet
Copy link

I'm using corber v1.3.8, and when I issue corber start --platform=android I keep getting error
No apk found (it actually appears twice)
image

I've opened the project in Android Studio, it builds in there, but corber start won't happen for me.

Also, possibly related, unless I open the AVD Manager every time before corber start, I'll get an error about No devices or emulators found, even though I have three in the Manager.
image

I'm thinking I may have corrupted by project somehow, so I reissued corber prepare in various incarnations to no avail.

Is there some way to get debug info so I can help myself and others determine what has gone wrong?

Thx!

@alexblom
Copy link
Member

Thank you for reporting this. The lack of emulators without running Android studio is concerning.

There are two paths we look for an Android APK which you can find here: https://github.com/isleofcode/corber/blob/master/lib/targets/android/utils/apk-path.js#L22-L24

Would you mind seeing if you have an APK in any of those locations - or somewhere similar?

Thanks!

@srobinet
Copy link
Author

Thank you for the response!

There are no APKs in any of those locations. In fact, on my system the gradlePath & studioPath exist up to the build part no output directories.

However, when I do a build in Studio manually, there is an APK generated here:
./⁨corber/⁨cordova⁩/⁨platforms⁩/android⁩/⁨app⁩/⁨buildx⁩/⁨intermediates⁩/⁨instant-run-apk⁩/⁨debug⁩/app-debug.apk

I admit I'm a little new to Cordova and the hybrid approach, so apologies if I'm a little sideways with this.

I failed to note beforehand that I'm using
Mac OS 10.14.3
Android Studio 3.3
Build #AI-182.5107.16.33.5199772, built on December 24, 2018
JRE: 1.8.0_152-release-1248-b01 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.3

@srobinet
Copy link
Author

srobinet commented Feb 23, 2019

I'm not sure where I got that path from before.
I rebuilt the app using Android Studio and the APK is at:
corber/cordova/platforms/android/app/build/outputs/apk/debug/app-debug.apk

In any case, I should know better than to confuse a ticket with two different issues.

Maybe we should concentrate first on figuring out why my emulators aren't detecting. I can't quite figure out a pattern. It works, then doesn't work until I shake my laptop violently or something, then it starts working. It's probably more logical than that though.

@srobinet
Copy link
Author

Logic prevails.

I "fixed" it by swapping lines 137 & 138 in lib/commands/start.js (i.e. put listAndroidEmulators() ahead of listAndroidDevices() call)

I don't have any devices, only emulators. Maybe something in listAndroidDevices() is causing an issue with the listAndroidEmulators() call.

Now I'm left with the "No apk found", but I should open another issue for that - but just to be sure, doing a corber start --platform=android should build an APK before trying to launch it, right?

@srobinet
Copy link
Author

Turns out I had to install Gradle through brew (the Studio install of it couldn't be found) and I had to apply execution rights to the gradlew wrapper file. Now everything operates as expected.

Shall I make a different ticket for this issue?

@alexblom
Copy link
Member

alexblom commented Mar 1, 2019

Thanks for all of the updates. That is definitely an unexpected setup step and we'll need to update docs - are you running on Mac or Linux?

@srobinet
Copy link
Author

srobinet commented Mar 1, 2019

I'm using Mac OS 10.14.3.

It's strange because I'm quite certain it all worked fine on my first project WITHOUT installing gradle separately - it used the Android Gradle instead. It was a second one where things went wonk.

I'll try another clean Ember project (not sure I mentioned that's what I was working with if it makes a difference) and see what I can reproduce.

@alexblom
Copy link
Member

alexblom commented Mar 8, 2019

Thanks! Let me know and we can debug further from there.

@srobinet
Copy link
Author

I tried on a brand new iMac and had the same series of difficulties but couldn't wrap my head around any of them. In the end we brew installed gradle and flipped those two lines of code (which I admit doesn't really seem like it should make a difference) and now it's up and running.

@alexblom
Copy link
Member

Interesting - thank you. I'm going to close this for now as I'm not sure what else we can debug.

If you find this issue from a Google search please flag.

Thanks for letting us know. Sometimes these setups can be hard to nail down (and write validators for!)

@AndrewDant
Copy link

AndrewDant commented May 2, 2019

I seem to have a very similar issue on Ubuntu 16.04, java 1.8.0_191, corber 1.3.10, gradle 5.4.1 installed via the steps at gradle.org/install/. When I try corber start I see 'No apk found' twice. When I look at corber/cordova/platforms/android/build/ there is no outputs/ folder. There is an app-debug.apk in corber/cordova/platforms/android/app/build/outputs/apk/debug/ and if I drag and drop that into my emulator it installs without issue, yet corber start isn't seeing it. Also my 'project' is just the default ember-quickstart tutorial since I wanted to try corber with the simplest thing possible before trying to convert a real project.

Edit: I have 6 AVD's on my system and all of them give the same error if I choose them with 'corber start' except the Pixel XL with API 28, which appears to start but then freezes and hangs until I close it, at which point corber outputs "emulator failed to start" twice. I also tried making a new Ember project with absolutely no changes except the rootUrl and locationType and I have the same problem in that project, except it says "No apk found" for every emulator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants