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

Android Sample Fails To Deploy #173

Closed
musictopia2 opened this issue Jun 19, 2021 · 13 comments
Closed

Android Sample Fails To Deploy #173

musictopia2 opened this issue Jun 19, 2021 · 13 comments

Comments

@musictopia2
Copy link

I tried the android sample. When I try to deploy, I get the error that says "The package does not support the CPU architecture of this device. I was using an Android 10 device. I would be disappointed if maui does not work on most android devices. The device I tried on is only 2 years old or so.

@VladislavAntonyuk
Copy link
Contributor

VladislavAntonyuk commented Jun 19, 2021

<RuntimeIdentifiers Condition="'$(TargetFramework)' == 'net6.0-android'">android-arm;android-arm64;android-x86;android-x64</RuntimeIdentifiers>
I described some issues and solutions here: https://vladislavantonyuk.azurewebsites.net/articles/The-first-project-with-.NET-MAUI

@musictopia2
Copy link
Author

Thanks. That fixed my problem. I was surprised they did not put that in the templates. Since I know, then even if they never do, its no problem. Means its best for a person to create their own custom templates then.

@jonathanpeppers
Copy link
Member

jonathanpeppers commented Jun 19, 2021

@musictopia2 we define <RuntimeIdentifiers>android-arm64;android-x86</RuntimeIdentifiers> by default. This covers new-ish devices and all emulators.

This means your device must be 32-bit? To check you can run:

> adb shell getprop ro.product.cpu.abilist
x86_64,x86

This was the output of a 64-bit emulator. What does your device print? I'm thinking it probably is armeabi-v7a.

@musictopia2
Copy link
Author

I tried to run via package console and it gave errors and would not say. What are the steps to run the command. Then I can tell you what it prints. I can say for sure that I have 4 devices and only one of them is newest. Its the one I purchased last year. Even the one purchased 2 years ago was an older one. I would not even know if I purchased a device if it was arm64 or x86. I assumed the issue could have been it only works on android 11. The device the original worked was 11 and all others was android 10. I would think it would be best to try to convince microsoft to default to the others so it covers more devices. The docs say its supposed to support all devices that has android 5 or above. I did really appreciate the code that was necessary so I was able to finally create apps for android (even with blazor) and maui.

@jonathanpeppers
Copy link
Member

The downside of us adding more RIDs by default, is it could increase build times by ~33%. Your devices are supported, you just have to list what RIDs you want in your app.

So did you have trouble running adb? On Windows you'd run "C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe" for the location VS installs, but I don't see what OS you're using.

@musictopia2
Copy link
Author

I ran it on the device that is around 2 years old and it showed
armeabi-7a,armeabi

@musictopia2
Copy link
Author

Then I ran on the one that previously worked and it did say arm64. The bad news is most devices sold for example at bestbuy is still older devices. A person usually has no way of knowing if they are purchasing a device that would work with the defaults now unfortunately.

@musictopia2
Copy link
Author

If the rids can't be added by default, i would suggest at least having some documentations of the possible devices plus the example you showed to run the command. When I ran the command, it failed because I used the package console. Once I knew the path, I went to the path and typed in the first command and it worked perfectly to show the devices.

@jonathanpeppers
Copy link
Member

I will see if we can get some data on the % of market share 32-bit Android devices have.

I think your problem is working as intended, but let us know if you have another issue, thanks.

@musictopia2
Copy link
Author

My problem was working as intended. The only pattern I have found is devices that uses android 11 is 64 bit and i did some research that showed that only 15 percent of android devices used the 11th version of the operating system. Unfortunately, most devices sold even at stores like best buy was 32 bit. I am just thankful that for the phone, I was not forced to get a 64 bit phone. The only android phone I am aware of that would be 64 bit costs nearly 1000 dollars. I purchased 2 phones around 18 months ago and it was still 32 bit. Unfortunately, a person has no way of knowing before purchase if its even 64 bit as well.

@jonathanpeppers
Copy link
Member

64-bit Android devices have existed since Android 5.0 (API 21). It has been required for apps to include 64-bit native libraries on Google Play.

The % market share number we need to see would be all Android versions and their CPU type. Share links if you have them, thanks.

@musictopia2
Copy link
Author

I am guessing it means that 64 bit are the more expensive devices. I have 2 phones that cost around 100 dollars but ended up being 32 bit. Its too bad that if somebody were to purchase a device, they would have no way of knowing if its 64 bit. Just curious if you can provide links to some 64 bit devices. The only one I am aware of is my newest device.

@jonathanpeppers
Copy link
Member

Any Google Pixel device I've had in the past few years is 64-bit.

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