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

Having Issues compiling to apk in Android Studio #157

Open
wants to merge 56 commits into
base: master
Choose a base branch
from

Conversation

Bankaimaster999
Copy link

I'm trying to update Ishiiruka with some fixes and I have already tested them with the older available source code of MMJ. I wanted to apply them to Ishiiruka to see if it would work as well since your Ishiiruka build is the main emulator I'm using.
So far I have been able to get Call of Duty Black Ops Zombies mode to work on the unofficial build after recompiling as you'll see here: https://www.youtube.com/watch?v=O0Md1-lltso

However when trying to generate the apk file in Android Studio with or without the fix I run into errors. You can see all here: https://stackoverflow.com/questions/62054559/errors-when-gradle-building-an-apk-from-source-code-need-help-or-guidance

I'm really fond of the Ishiiruka build and want to play Zombies mode on it and do more testing to see if I can update it as well or at least trial and error. I wanted to know if its possible that you can assist me with some guidance on how to generate the apk with Android Studio or correct the errors I'm getting?
I have no intention of making the app my own but I do want to update it and make other users more aware of Ishiiruka build.
Please contact me at [email protected].

Tinob and others added 30 commits July 24, 2016 19:11
Allows CMake to find system hidapi.
The flag -std=c++11 is needed for xBRZ to compile but it is not
correctly passed by CMake, at least in macOS. Added it to the
corresponding CMakeLists.txt

The flag is added if compiling under macOS or Linux.
This also adds the flag when compiling under Linux
as well as macOS.
@Tinob
Copy link
Owner

Tinob commented May 29, 2020

by rebasing i mean base your changes on the latest version of ishiiruka instead of v6.

@Bankaimaster999
Copy link
Author

by rebasing i mean base your changes on the latest version of ishiiruka instead of v6.

I didn't even know that there was a new version of Ishiiruka for Android!
What's the latest version and where can I find it?
Is it's source code available too?

@Tinob
Copy link
Owner

Tinob commented May 30, 2020

the andoird codebase is present in the latest version on Master repository but i never tryed to build it because of my lack of time. i'm aware that it needs fixes to work, if your are willing to help me we can fix it and make it work.

@Bankaimaster999
Copy link
Author

Bankaimaster999 commented May 30, 2020

the andoird codebase is present in the latest version on Master repository but i never tryed to build it because of my lack of time. i'm aware that it needs fixes to work, if your are willing to help me we can fix it and make it work.

Right now I solved the issues with Android Studio not finding the NDK and having configuration issues when loading the build.gradle and it loads easily now BUT whenever I try to build the apk, I get the same set of build errors I that I mentioned here: https://stackoverflow.com/questions/62054559/errors-when-gradle-building-an-apk-from-source-code-need-help-or-guidance

I'm hoping I can find the answer to solving those errors but since I'm learning about Android Studio, C++ coding and Java on my own (100% novice) .... All I can say is that I'll do my best~
If I need guidance on figuring things out is there anyway we can easily communicate outside posting these comments? Not that I want to disturb your schedule with questions but if there is another platform that is more efficient for exchanging Ideas or receiving some guidance please email me on whether you're ok with that and what platform you'd prefer using or that you would rather not.

Honestly, It can get a little frustrating because right now, without any fixes applied, I can't even build the apk with its own files from github. Meaning my progress is still at 0% with ishiiruka or barely close to 50%. I just need to be able to build the apk .....

[Update]
I think the issue has to do with the clang in the build.gradle .....still not too sure but looking into it.
If I remove these lines from "Ishiiruka-master\Source\Android\app\build.gradle"

externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
}
}

The apk gets built without issues but when you install it, open it and give it access to storage --> it will crash immediately and continue to crash whenever you attempt to open it. So I'm a little closer to identifying what the error is but still not sure. What do you think it might be?

@Bankaimaster999
Copy link
Author

No matter what I do, I still run into this compilation error:

org.gradle.internal.UncheckedException: compilation command failed.
Error executing process C: \ Android \ SDK \ cmake \ 3.10.2.4988404 \ bin \ cmake.exe with arguments {--build C: \ Users \ SkylerJ \ Desktop \ Ishiiruka-master \ Source \ Android \ app \ .externalNativeBuild \ cmake \ release \ arm64-v8a --target StringUtilTest}

I have downloaded all the plugins for it but still not sure why it is not compiling the apk.
Any advice?

@Tinob
Copy link
Owner

Tinob commented Jun 2, 2020

can you share the fuill build log?

@Bankaimaster999
Copy link
Author

can you share the fuill build log?

Well everything should be in here:
https://stackoverflow.com/questions/62054559/errors-when-generating-an-apk-any-solutiion
Including details of all the errors.

Thanks in advance for any guidance!

@Bankaimaster999
Copy link
Author

Bankaimaster999 commented Jun 6, 2020

Better yet are you able to compile the master version on github to an apk?
If you can, then what is your Android studio version, gradle version and ndk version?

I have yet to be able to compile the source code to an apk ... I keep running into various errors and even when I change things in the Android/app/build.gradle I just get a new set of errors during the build.
Without being able to successfully build the regular ishiiruka-master to an apk there is no way I can apply fixes and make an updated apk.
I'll keep at it but I'm losing motivation to continue trying ....
I can easily build the MMJ source code: https://github.com/weihuoya/dolphin/tree/5.0-10413
I just don't undestand why Ishiiruka is so hard to build ...I don't know am I doing something wrong?

@Tinob
Copy link
Owner

Tinob commented Jun 6, 2020

Never tryed to compile ishiiruka to android, but looking at your error log it seems that you have a modified version of ishiiruka because i see code that is not on ishiiruka anymore. are you able cto compile your code for windows?

@Bankaimaster999
Copy link
Author

Bankaimaster999 commented Jun 6, 2020

Never tryed to compile ishiiruka to android, but looking at your error log it seems that you have a modified version of ishiiruka because i see code that is not on ishiiruka anymore. are you able cto compile your code for windows?

I am using the exact code straight from github .... downloaded the zip file and opened the gradle build here: (Source/Android/build.gradle) ---> then it opens in Android Studio and loads --> then I clicked build --> generate signed bundle/Apk --> selected APK (signed) --> made a new keystore path + password --> Selected Build variant as "release" --> selected signature version as both V1 (Jar Signature) and V2 (Full Apk signature) --> Clicked Finish to run the building process (just like I did for MMJ) ......After about a minute or less; the build fails with an error(s).

I haven't modified anything ...all I want to do is build the apk with its original files and once I can build it WITHOUT any modifications then I will attempt to apply my fixes or edit the files. That's what I did with MMJ as well; I made sure it could be built properly first before editing anything.
So there is something wrong with the github files, please fix it or try to compile it yourself successfully in Android Studio to see what I'm talking about and then let me know. I thought that Ishiiruka had both a Windows version and Android version since there is a wrapper for it in the source code and I was also told that the github source code and be used to make an Android version.

Also, I did say in the beginning that I wanted to make an apk (ie. an android app version of Ishiiruka); which there is already one online but no source code given. The person who successfully made it/ edited it (I honestly don't know what he did to create it) said he used Ishiiruka master to do it. Unfortunately for me he only speaks Spanish and it doesn't seem like he wants to readily divulge his methods to me either and that's why I'm contacting you for guidance....

His exact translated words in response to where he got his source:
"If you can get the code on github mmj and ishiiruka"

When I told him about the errors and what he did to build the apk he responded with this:
"You may have to download a plugin or something you lack for compilation, on github they explain everything about how to compile"

So far no more responses from him and that's since 30th May 2020. I have followed all compilation instructions hence, me being able to compile MMJ but Ishiiruka is just not working out. He also has a youtube channel showcasing Ishiiruka App/Apk here: https://www.youtube.com/watch?v=ht7Jn8C9iMk (it just doesn't have the fixes I want to apply)

@Tinob
Copy link
Owner

Tinob commented Jun 8, 2020

found the problem will try to fix it and cheking the changes when i have a little free time.

@Bankaimaster999
Copy link
Author

found the problem will try to fix it and cheking the changes when i have a little free time.

OMG REALLY!!!??
I'm already crazy excited to see the changes!
Thanks for all the follow ups and updates despite your schedule and the willingness to work with me.
Hope all things go well and we can really help out everyone with updating Ishiiruka for Android!

@Tinob
Copy link
Owner

Tinob commented Jun 10, 2020

compilation should be fixed.

@Bankaimaster999
Copy link
Author

Bankaimaster999 commented Jun 10, 2020

compilation should be fixed.

Thanks for the update; I'm trying to open the "build.gradle" to load it before building the apk but running into this error:
"Desktop\keystore.properties (The system cannot find the file specified)"

I think when you updated the files, they weren't public released files? Not sure why that's happening but since its not loading because of that I'll have to look into it.

I'll keep you posted!

@Tinob
Copy link
Owner

Tinob commented Jun 10, 2020

you need to create thaht file and configure the path and credential for your key store

@Bankaimaster999
Copy link
Author

Bankaimaster999 commented Jun 11, 2020

you need to create that file and configure the path and credential for your key store

So after quite a while, I was FINALLY, able to build the apk !!! Thanks for all the hard work so far BUT one more issue came up after it was built ..... for some reason, even if I give the app "storage permissions", it doesn't allow me to see any folders/sub-folders in internal storage + SD card. You can see the issue here:
https://youtu.be/mUCThmeUfbM

I will try to see if I can take a page out of that "Cholodroid" guy who made the unofficial ishiiruka v6 apk and use Dolphin MMJ as a reference to try and fix the issue but if you know what the problem is then could you please fix the files whenever you are free? Without access to either internal or external storage (via SD card) I can't run games to test them .... far less, tweak the emulator with new fixes despite finally building the apk ...

There is a possibility that I could have built it incorrectly or with errors; I'm not sure but if you run into the same issues then let me know~

@Tinob
Copy link
Owner

Tinob commented Jun 11, 2020

tha is werir is working perfectly on my phone, can you try using this apk?
https://drive.google.com/file/d/1rV4GkA54eU14h3xjXB7C5JDnuwi2L3gM/view?usp=sharing

@Bankaimaster999
Copy link
Author

Bankaimaster999 commented Jun 11, 2020

tha is werir is working perfectly on my phone, can you try using this apk?
https://drive.google.com/file/d/1rV4GkA54eU14h3xjXB7C5JDnuwi2L3gM/view?usp=sharing

Says I need access.

If your apk works then it must be something on my end so I'll have to check it out for sure but yea, need that access please and thanks~

@Tinob
Copy link
Owner

Tinob commented Jun 11, 2020

sorry the other link was wrong try this
https://drive.google.com/file/d/1rV4GkA54eU14h3xjXB7C5JDnuwi2L3gM/view?usp=sharing

@Bankaimaster999
Copy link
Author

Bankaimaster999 commented Jun 11, 2020

sorry the other link was wrong try this
https://drive.google.com/file/d/1rV4GkA54eU14h3xjXB7C5JDnuwi2L3gM/view?usp=sharing

Thanks for the share. I responded to you with an reply email but I'll post what I said here as well:
"Ok so a couple of things I noticed with your apk and mine:

  • Mine is 10.1 Mb and Yours is 14.1 Mb ....so if we're building using the same source + Android studio config then Mine is missing stuff
    [I figured out why its missing stuff ...I changed the gradle.build in mine to only build for "arm64-v8a"]

  • Second I just tried your apk and same issue occur; there is nothing shown once again. See here:
    https://www.youtube.com/watch?v=YRlHG4ZMs9k

One last thing to mention is that my device I'm testing everything on is a Pocophone F1 (rooted) with a custom Rom + kernel with the latest Adreno GPU Drivers v464.0. I doubt that would affect Ishiiruka but I'll mention it in the event that maybe the problem (All emulators work on my set up as well including all other versions of Dolphin - Official/MMJ/Ishiiruka (other)/ Mod)"

@Tinob
Copy link
Owner

Tinob commented Jun 11, 2020

Ok , will test in the Android emulator, because in my Remi note 7 it works by just installing and Allowing the app to acces the storage.

@Bankaimaster999
Copy link
Author

Bankaimaster999 commented Jun 11, 2020

Ok , will test in the Android emulator, because in my Remi note 7 it works by just installing and Allowing the app to acces the storage.

Weird right? We're both building the Release versions but not all devices can use it ...
I'll continue to see if I can customize it more like MMJ to see if it will fix the issue ... but not sure if that will work out with my knowledge base. Anyways I'll keep you posted and await your results from further testing.

[Update]
So I managed to install the apk I built on another device (Galaxy S7 - not my device but it works) and it was able to read the storage without issue. The only 2 difference between my device and the S7 is that:

  1. My device is Rooted with a custom rom which is causing an issue with Ishiiruka (still don't understand why)
  2. My device is on Android 10 vs the S7 Android 8.

So I will try to rebuild the device with Android 10 as the max target to see if there are any changes but other than that do you have any idea on how to give compatibility to custom roms? (Never really had such an issue before)

@Tinob
Copy link
Owner

Tinob commented Jun 12, 2020

folder browsing should be fixed in thelatest version.

@Bankaimaster999
Copy link
Author

folder browsing should be fixed in thelatest version.

Ok I think it might be related to my device running a custom rom but I fail to understand why every other emulator works including every dolphin variant (Official/MMJ/Ishiiruka (other)/Mod) except this one ....
I will still try to figure it out but many people have custom roms like me so in addition to my issues just for using the app on my device I wish that other users with any Rom/configuration can use Ishiiruka.
However, in my case it still stands that I need it to work with my device in order for me to do any testing on my own and update with fixes .....
Thanks for all the hard work and if you do figure out something or make any further changes to the files I'll looking out for it but I now have to see other options in modifying the app or my device rom to see if I can get it running.

@Tinob
Copy link
Owner

Tinob commented Jun 12, 2020

sorry it was my fault, forgot to push the changes now should be fixed.

@Bankaimaster999
Copy link
Author

Bankaimaster999 commented Jun 12, 2020

sorry it was my fault, forgot to push the changes now should be fixed.

YES !!!! Just built it and file browser is working !
So now I'm going to do testing on it to see what's working and do some comparisons with the current running emulators to ensure performance is there and if there are no further issues I'll add the fixes and one or 2 customizations.
I'll definitely keep you and the forum updated on the progress and findings~

Again, thanks for all the hard work on getting the emulator Android Ready and following up with me consistently and quickly to get it there despite your busy schedule!

[Update]
So I was able to do a quick test and find a few issues so far (more testing is in order);

    • Touchscreen controls do not work
    • Not all games are displayed in the game sections (eg. I have Resident Evil 4 Disc 1+2 but it only shows disk 2)
    • Wii game banners do not display
    • Wii input settings are blank
    • Always get an error saying "failed to compile ps shader" but it still emulates the game. (I also think that the Shader system needs to be improved)
    • The app emulates well but FPS needs to be improved (Used Mario Kart double dash as a test game and FPS range during opening cutscene = 47-35 fps frequently whereas with the other unofficial versions = 57-60 fps with 60fps being more constant.)
    • Overall look and box art needs to be revamped and modernized to match the other emulators.
    • Overall feel of the emulator is still a bit clunky (eg. When you click a game to play, the image gets distorted and slightly pushed aside before it loads, when you click "back" to exit the game there is a longer wait than expected to get back to menu, while rotating the device as well during emulation has a rather weird wait time for things to settle)

So that's just the pre-investigation into the build and I'll be working to see if I can tackle those issues and fix or improve them so wish me luck. If you ever update the source code with any fixes to these let me know and I'll retest things.
Anyways I'll keep you posted on any changes~

@Tinob
Copy link
Owner

Tinob commented Jun 12, 2020

the touch screen controls for me need to be relocated to work, about the other issues Im aware, those are missing functionalities from master, Will be gladd to merge those fixes if you make the pull request, Wiill let you know if i willl change something to avoid conflicts.

@Bankaimaster999
Copy link
Author

Bankaimaster999 commented Jun 13, 2020

the touch screen controls for me need to be relocated to work, about the other issues Im aware, those are missing functionalities from master, Will be gladd to merge those fixes if you make the pull request, Wiill let you know if i willl change something to avoid conflicts.

No problem and I'll do the same ~
Once again, thanks for the updates!

@Bankaimaster999
Copy link
Author

I want to give the Ishiiruka custom app (purple one) the same toggle function as seen in the Dolphin apk.
See in my video here = https://youtu.be/9SIhfX_TDqk

I'm doing tests using the other apps before doing a complete overhaul on the Ishiiruka you updated.

Please let me know of any ideas~

@ghost
Copy link

ghost commented Oct 28, 2021

Any updates about this?

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

Successfully merging this pull request may close these issues.

3 participants