mosra / toolchains

Toolchains for crosscompiling with CMake.
https://magnum.graphics/
The Unlicense
91 stars 31 forks source link

Unable to import APK through Android Studio #11

Open hsdk123 opened 4 years ago

hsdk123 commented 4 years ago

I've just managed to get up to apk packaging completing, and now trying to debug, I've initially tried importing the APK through Android Studio (option: Profile or debug APK), but I'm getting errors when selecting the cmake built file:

APK Import
Unable to find file
'Users/hkim809/ApkProjects/MyApplication/small/classes.dex'

Any ideas?

mosra commented 4 years ago

I took most of the internals from fips, and it seems mirroring this commit would make things work again: https://github.com/floooh/fips/commit/63fdb7a332e17cda2d3435a2dc72829606815db7

Unfortunately right now I'm unable to set up Android build locally (the SSD on this mac mini is too small, heh), so you'd either have to try to tackle this yourself or wait until I have a real computer again (in three weeks, hopefully).

hsdk123 commented 4 years ago

Hmm, looks as if those lines are just doing some symbol replacement to get things working 'again'. (implying something was up before and that might just be a bug fix on top)

I've looked around the repo, and it seems there's some core steps run to build the dex: https://github.com/mosra/toolchains/issues/11#issuecomment-570039090

Seems like a src directory is created then somehow a /R.java is pulled in, built, and then a dex created afterwards through a separate command.

I think I can wait 3 weeks, so I might go back to try tackling the iOS build and emscripten build first. Will update though if I dabble into this again, but when that real computer comes in, let me know!

mosra commented 4 years ago

@hsdk123 were you able to make any progress on this? I'm coming back to this with absolutely no prior knowledge of what the APK should or should not have, so ¯\_(ツ)_/¯

Or did the extra commits in #10 solve this in any way?

hsdk123 commented 4 years ago

Actually not really, Android Studio and Gradle were a pain and I couldn't even get things to build.... I did however spend about a week though looking through what should be happening, here are a couple of links I jotted down along the way:

mosra commented 4 years ago

Thanks a lot for the links. I can imagine the pain behind, haha :)