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

Building #83

Open
loomahtoomah opened this issue Feb 28, 2024 · 3 comments
Open

Building #83

loomahtoomah opened this issue Feb 28, 2024 · 3 comments

Comments

@loomahtoomah
Copy link

On mac, building yields a million errors. Does anyone mind just sharing a built Android 13 apk?

@kwsch
Copy link
Owner

kwsch commented Feb 28, 2024

Please be more descriptive in the errors you are receiving.

As mentioned multiple times, this is a proof of concept app that isn't being actively developed. GitHub is not a place for requesting builds for arbitrary platform version targets.

@loomahtoomah
Copy link
Author

Per the provided instructions we are to first from the Build menu select Clean Solution. I don't have that as an option. There are options for Clean All, or Clean PKHeX.mobile or Clean PKHex.Android, however. I just choose Clean All and proceed. From there, we're to Build->Rebuild All. Again, not an option at all. I can rebuild Solution, PKHeX.Android, or PKHeX.Mobile, but there's no Rebuild All.

What I've been assuming is there has been an update or something to visual studio, which is why the options don't exist for me. Or it could be since I'm on Mac it's different on my platform, so I've just been trying to clean and build PKHeX.Mobile since, idk, that's the master or parent folder? I'm not a developer so I'm doing the best I can with what I've got.

Anyway, cleaning goes fine, but when I rebuild I Build->Rebuild PKHeX.Mobile I'm hit with like 20 errors: Line 152 The variable 'ex' is declared but never used (CS0168) (PKHeX.Mobile). Line 0 Warning FodyPackageReference: Fody: The package reference for PropertyChanged.Fody does not contain PrivateAssets='All' (FodyPackageReference) and so on and so forth.

I just figured since Android is Android someone who knows what they're doing could just compile/build the thing and toss an apk online somewhere so dummies like me could mess around with it.

@jcoddaire
Copy link

jcoddaire commented May 21, 2024

Hi, chiming in here. I am not affiliated with this project but I do have extensive experience with .NET solutions.

Some of these errors are not actually build-breaking errors. .NET applications have Warnings and Errors for the msbuild agent. This is what Visual Studio uses behind the scenes to build a csproj application. More on that is here.

I was able to build PKHeX.Mobile on a Macbook Pro M1 Max, 2021 laptop. Here are my duplication steps:

Install dependencies

  1. Manually install .NET Core 8 from here
  2. Execute the following commands in your terminal. Maintainer, it might be a good idea to make a github job that builds these. Or Azure if that is what you are using for CI/CD.
brew install mono
brew install mono-libgdiplus

Verify installs

Enter the following commands in a new terminal to verify the programs above have been configured correctly.

dotnet --version
git --version
mono --version

Project commands

I use VSCode, but any text editor and terminal tooling should work. Execute the following commands in any terminal.

git clone https://github.com/kwsch/PKHeX.Mobile.git
cd PKHeX.Mobile
dotnet clean
dotnet build
dotnet build -c Release

More on the dotnet build tool is available here.

Note that this outputs the "error" you mention:

warning CS0168: The variable 'ex' is declared but never used

Which if you read the output, is due to this: https://github.com/kwsch/PKHeX.Mobile/blob/master/PKHeX.Mobile/Logic/FileUtil.cs#L152

The ex variable is never used, so either don't catch the Exception or log it to the console or logger library you are using, ie

Console.WriteLine(ex.Message)

I also see this warning:

warning FodyPackageReference: Fody: The package reference for PropertyChanged.Fody does not contain PrivateAssets='All

I have never saw that before, but google is your friend.

Either way, the build is successful.

Check PKHeX.Mobile/PKHeX.Mobile/bin/Release/netstandard2.1/PKHeX.Mobile.dll for your program. This is a library, not an .exe file.

My build issues

To the project maintainer, I do get build issues for the ios and Android projects. Maybe I do not have something for those installed?

iOS

Duplication steps:

cd PKHeX.iOS
dotnet build
/PKHeX.Mobile/PKHeX.iOS/PKHeX.iOS.csproj(166,3): error MSB4019: The imported project "/usr/local/share/dotnet/sdk/8.0.300/Xamarin/iOS/Xamarin.iOS.CSharp.targets" was not found. Confirm that the expression in the Import declaration "/usr/local/share/dotnet/sdk/8.0.300//Xamarin/iOS/Xamarin.iOS.CSharp.targets" is correct, and that the file exists on disk.

Android

Duplication steps:

cd PKHeX.Android
dotnet build
PKHeX.Android/PKHeX.Android.csproj(140,3): error MSB4019: The imported project "/usr/local/share/dotnet/sdk/8.0.300/Xamarin/Android/Xamarin.Android.CSharp.targets" was not found. Confirm that the expression in the Import declaration "/usr/local/share/dotnet/sdk/8.0.300//Xamarin/Android/Xamarin.Android.CSharp.targets" is correct, and that the file exists on disk.

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