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

[Xamarin.Android.Build.Tasks] Ignore AndroidAsset items which are folders. #1190

Merged
merged 3 commits into from
Jan 16, 2018

Conversation

dellis1972
Copy link
Contributor

When adding a new subfolder in the IDE (VSForMac) we end up
with a folder which has a build action of AndroidAsset.
This causes the copy task to fail with

Cannot copy <folder> to <destfolder>, as the source file doesn't exist",

This is because we assume that all items in AndroidAsset (and
AndroidResource) and files. It looks like this is not the case.
While a work around is easy .. simply remove the item. It does
require that the user manually update the csproj.

So this commit uses Directory.Exists to check to see if the
item is a directory or not. If it is we skip over it. Otherwise
its a file so we should copy.

We do this in Files.cs but also in AndroidUpdateResDir.cs.
The latter has been changed to output a list of the "Resolved"
files which will not include any folders.

…ders.

When adding a new subfolder in the IDE (VSForMac) we end up
with a folder which has a build action of AndroidAsset.
This causes the copy task to fail with

	Cannot copy <folder> to <destfolder>, as the source file doesn't exist",

This is because we assume that all items in AndroidAsset (and
AndroidResource) and files. It looks like this is not the case.
While a work around is easy .. simply remove the item. It does
require that the user manually update the csproj.

So this commit uses `Directory.Exists` to check to see if the
item is a directory or not. If it is we skip over it. Otherwise
its a file so we should copy.

We do this in `Files.cs` but also in `AndroidUpdateResDir.cs`.
The latter has been changed to output a list of the "Resolved"
files which will not include any folders.
@dellis1972
Copy link
Contributor Author

build

@jonpryor
Copy link
Member

The cause of the PR build break:

…/xamarin-android/tests/BCL-Tests/Xamarin.Android.Bcl-Tests/Xamarin.Android.Bcl-Tests.csproj (SignAndroidPackage) ->
…/xamarin-android/bin/Debug/lib/xamarin.android/xbuild/Xamarin/Android/Xamarin.Android.Common.targets (_BuildApkEmbed target) ->
	…/xamarin-android/bin/Debug/lib/xamarin.android/xbuild/Xamarin/Android/Xamarin.Android.Common.targets:
error : Error executing task BuildApk: Could not find file "…/xamarin-android/bin/Debug/lib/xamarin.android/xbuild/Xamarin/Android/lib/arm64-v8a/libmono-android.debug.so"

is because the new Xamarin.Android.Bcl-Tests.csproj explicitly sets $(AndroidSupportedAbis) to include all ABIs.

(Compare to e.g. d15-6.)

@dellis1972: Please update Xamarin.Android.Bcl-Tests.csproj so that it only requires armeabi-v7a;x86, so that the PR builds can build. :-)

@dellis1972
Copy link
Contributor Author

build

@dellis1972
Copy link
Contributor Author

yay green builds :)

@jonpryor jonpryor merged commit 665cb59 into dotnet:master Jan 16, 2018
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Apr 21, 2021
Changes: xamarin/monodroid@45abd3f...ed584c7

  * xamarin/monodroid@ed584c775: [tools/msbuild] Improve FastDeploy error messages (dotnet#1190)
  * xamarin/monodroid@74294dca0: Bump to xamarin/androidtools@47ec118f (dotnet#1195)
  * xamarin/monodroid@ff633623e: [tools/msbuild] Add additional diagnostic logging for FastDev. (dotnet#1194)
  * xamarin/monodroid@546d5fb58: [tools/msbuild] Add Better Diagnostic Logging for Fast Deployment. (dotnet#1185)
  * xamarin/monodroid@fa6a1a058: [tools/msbuild] incude PackageName in MAX_COMMAND adb check. (dotnet#1189)
  * xamarin/monodroid@ac447cb5d: Bump Xamarin.Android to bring in JDK Fixes (dotnet#1192)
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Apr 22, 2021
Changes: xamarin/monodroid@ff63362...76c04cd

  * xamarin/monodroid@76c04cd15 [tools/msbuild] [MSB3680] The source file "obj/Debug/androidx/jl/classes.dex" does not exist (dotnet#1197)
  * xamarin/monodroid@ed584c775 [tools/msbuild] Improve FastDeploy error messages (dotnet#1190)
  * xamarin/monodroid@74294dca0 Bump to xamarin/androidtools@47ec118f (dotnet#1195)
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Apr 22, 2021
Fixes: dotnet#5863

Changes: xamarin/monodroid@ff63362...76c04cd

  * xamarin/monodroid@76c04cd15 [tools/msbuild] [MSB3680] The source file "obj/Debug/androidx/jl/classes.dex" does not exist (dotnet#1197)
  * xamarin/monodroid@ed584c775 [tools/msbuild] Improve FastDeploy error messages (dotnet#1190)
  * xamarin/monodroid@74294dca0 Bump to xamarin/androidtools@47ec118f (dotnet#1195)
jonpryor added a commit that referenced this pull request Apr 26, 2021
Fixes: #5863

Changes: xamarin/monodroid@ff63362...76c04cd

  * xamarin/monodroid@76c04cd15 [tools/msbuild] [MSB3680] The source file "obj/Debug/androidx/jl/classes.dex" does not exist (#1197)
  * xamarin/monodroid@ed584c775 [tools/msbuild] Improve FastDeploy error messages (#1190)
  * xamarin/monodroid@74294dca0 Bump to xamarin/androidtools@47ec118f (#1195)
jonathanpeppers pushed a commit that referenced this pull request Apr 26, 2021
Fixes: #5863

Changes: xamarin/monodroid@ff63362...76c04cd

  * xamarin/monodroid@76c04cd15 [tools/msbuild] [MSB3680] The source file "obj/Debug/androidx/jl/classes.dex" does not exist (#1197)
  * xamarin/monodroid@ed584c775 [tools/msbuild] Improve FastDeploy error messages (#1190)
  * xamarin/monodroid@74294dca0 Bump to xamarin/androidtools@47ec118f (#1195)
@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants