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] Unable to deploy after rebuild #106

Closed
10 tasks
nickrandolph opened this issue Mar 24, 2023 · 6 comments · Fixed by unoplatform/uno#11860
Closed
10 tasks

[Android] Unable to deploy after rebuild #106

nickrandolph opened this issue Mar 24, 2023 · 6 comments · Fixed by unoplatform/uno#11860
Assignees
Labels
kind/bug Something isn't working priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. triage/untriaged Indicates an issue requires triaging or verification.

Comments

@nickrandolph
Copy link
Contributor

Current behavior

Forcing a rebuild on Mobile project prevents Android app from being able to be deployed with following errors:
12:59:43:995 APT2260: resource drawable/splash_screen (aka com.companyname.UnoApp1:drawable/splash_screen) not found.
12:59:43:996 APT2260: resource drawable/splash_screen (aka com.companyname.UnoApp1:drawable/splash_screen) not found.
12:59:43:996 APT2260: resource drawable/splash_screen (aka com.companyname.UnoApp1:drawable/splash_screen) not found.
12:59:43:996 APT2260: resource drawable/splash_screen (aka com.companyname.UnoApp1:drawable/splash_screen) not found.
12:59:43:996 APT2062: failed linking references.

Expected behavior

No errors and successful deploy/run

How to reproduce it (as minimally and precisely as possible)

  • Create new project using Blank preset in Wizard
  • Build and run the Mobile project
  • Force Rebuild on the Mobile project
  • Press Run which should deploy and run the project but will fail with errors

Environment

Nuget Package:

Package Version(s):

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renders for Xamarin.Forms
  • Windows
  • Build tasks

Visual Studio:

  • 2017 (version: )
  • 2019 (version: )
  • for Mac (version: )

Relevant plugins:

  • Resharper (version: )

Anything else we need to know?

@nickrandolph nickrandolph added kind/bug Something isn't working priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. triage/untriaged Indicates an issue requires triaging or verification. labels Mar 24, 2023
@jeromelaban
Copy link
Member

This may be an uno issue. If you can create a binlog of the issue reproducing, we may be able to find a fix.

@pictos
Copy link
Contributor

pictos commented Mar 24, 2023

@jeromelaban I recorded all the binlogs for the steps mentioned by Nick. Let me know if it's something here or on Uno.

1_FirstBuild.zip
2_Rebuild.zip
3_DeployAndFail.zip

@Youssef1313
Copy link
Member

Youssef1313 commented Mar 29, 2023

Maybe related to? dotnet/android#6534
But we should find a workaround anyway.

Also, the _GenerateAndroidResourceDir might be incorrectly being skipped?

@Youssef1313
Copy link
Member

Youssef1313 commented Mar 29, 2023

@pictos Would you be able to test if <CallTarget Targets="_GenerateAndroidResourceDir" /> would workaround this issue? We would force _GenerateAndroidResourceDir after resizetizer does its work by adding the CallTarget just after this line:

@pictos
Copy link
Contributor

pictos commented Mar 29, 2023

@Youssef1313 I'll give it a try and post the results here ASAP

@Youssef1313
Copy link
Member

Youssef1313 commented Mar 29, 2023

dotnet/android#7780 have fixed a similar error.

I tried to include what is in that PR like this:

	<Target Name="WorkaroundXamarin7780" Condition="'$(_ResizetizerIsAndroidApp)' == 'True'" AfterTargets="_ResolveLibraryProjectImports">
		<ItemGroup>
			<FileWrites Include="$(_AndroidLibraryProjectImportsCache)"
				Condition="Exists ('$(_AndroidLibraryProjectImportsCache)')"/>
		</ItemGroup>
	</Target>

but it didn't work.

Also force running _GenerateAndroidResourceDir with my suggestion above didn't work (Thanks Pedro for testing it).

I found a different way to force run this target by deleting _AndroidResFlagFile before it's run, but that didn't work too.

I'm out of ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. triage/untriaged Indicates an issue requires triaging or verification.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants