Skip to content

Conversation

@4brunu
Copy link
Contributor

@4brunu 4brunu commented Dec 9, 2021

This PR depends on #436 and can only be merged after it.

This PR is a continuation of #419

Support Libraries Version (eg: 23.3.0):

Compose bindings that are essential to bind native android libraries that use jetpack compose.

- androidx.activity:activitycompose -  -> 1.4.0
- androidx.compose.ui:uitooling -  -> 1.1.1
- androidx.compose.ui:uitoolingpreview -  -> 1.1.1
- androidx.compose.ui:uitoolingdata -  -> 1.1.1
- androidx.lifecycle:lifecycleviewmodelcompose -  -> 2.4.0
- com.google.android.material:composethemeadapter -  -> 1.0.0
- io.github.aakira:napier -  -> 1.4.1
- com.google.accompanist:accompanistappcompattheme -  -> 0.16.0
- com.google.accompanist:accompanistdrawablepainter -  -> 0.16.0
- com.google.accompanist:accompanistflowlayout -  -> 0.16.0
- com.google.accompanist:accompanistpager -  -> 0.16.0
- com.google.accompanist:accompanistpagerindicators -  -> 0.16.0
- com.google.accompanist:accompanistpermissions -  -> 0.16.0
- com.google.accompanist:accompanistplaceholder -  -> 0.16.0
- com.google.accompanist:accompanistplaceholdermaterial -  -> 0.16.0
- com.google.accompanist:accompanistswiperefresh -  -> 0.16.0
- com.google.accompanist:accompanistsystemuicontroller -  -> 0.16.0
- androidx.activity:activityktx -  -> 1.3.0
- androidx.lifecycle:lifecycleviewmodelktx -  -> 2.3.0
- androidx.compose.ui:ui -  -> 1.0.0

Does this change any of the generated binding API's?

No.

Describe your contribution

Those bindings are important to bind native android libraries that use jetpack compose, since they are very commonly used.

#352 introduced initial support for Jetpack Compse.

But there are some important missing packages.

For example, without androidx.activity:activity-compose it's not possible to call compose from an Activity, hence, it's not possible to use compose at all.

Without androidx.compose.ui:ui-tooling* it's not possible to use one of the best features of compose that are previews.

Without com.google.android.material:compose-theme-adapter and com.google.accompanist:accompanist-appcompat-theme it's not possible to reuse the existing theme from Views in the compose world.

And there are more packages in the com.google.accompanist:*, that are extensions to compose that make compose much more powerful and easy to use.

@4brunu 4brunu changed the title Bind important missing compose stable packages [DEPENDS ON OTHER PR] Bind important missing compose stable packages Jan 31, 2022
@4brunu
Copy link
Contributor Author

4brunu commented Mar 15, 2022

Hey @moljac, could you please help to review and merge this PR? Thanks

@moljac
Copy link
Contributor

moljac commented Mar 15, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@4brunu
Copy link
Contributor Author

4brunu commented Mar 17, 2022

@moljac Did it fail? Could you please share the errors? Thanks

@moljac
Copy link
Contributor

moljac commented Mar 17, 2022

========================================
binderate
========================================
Unhandled exception. System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at System.Net.Http.HttpClient.GetStreamAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
   at MavenNet.GoogleMavenRepository.GetArtifactsAsync(String groupId)
   at MavenNet.MavenRepository.GetArtifactsAsync(String groupId, String[] artifactIds)
   at MavenNet.MavenRepository.Populate(String groupId, String[] artifactIds)
   at AndroidBinderator.MavenFactory.Initialize(BindingConfig config) in D:\a\1\s\Util\Xamarin.AndroidBinderator\Xamarin.AndroidBinderator\MavenFactory.cs:line 33
   at AndroidBinderator.Engine.BinderateAsync(BindingConfig config) in D:\a\1\s\Util\Xamarin.AndroidBinderator\Xamarin.AndroidBinderator\Engine.cs:line 37
   at Xamarin.AndroidBinderator.Tool.Program.Main(String[] args) in D:\a\1\s\Util\Xamarin.AndroidBinderator\Xamarin.AndroidBinderator.Tool\Program.cs:line 67
   at Xamarin.AndroidBinderator.Tool.Program.<Main>(String[] args)
An error occurred when executing task 'binderate'.
Error: One or more errors occurred. (Process xamarin-android-binderator exited with code 57005.)
	Process xamarin-android-binderator exited with code 57005.

@4brunu
Copy link
Contributor Author

4brunu commented Mar 21, 2022

@moljac Thanks for the help.
Is there any more info related which artifact cannot be found?
Is there any way for me to test this locally?
Thanks

@moljac
Copy link
Contributor

moljac commented Mar 21, 2022

      {
        "groupId": "io.github.aakira",
        "artifactId": "napier",
        "version": "1.4.1",
        "nugetVersion": "1.4.1",
        "nugetId": "Xamarin.AAkira.Napier",
        "dependencyOnly": false
      },

https://github.com/4brunu/XamarinAndroidX/blob/feature/more-compose-stable-packages/config.json#L1539-L1546

not google maven repo

https://repo1.maven.org/maven2/io/github/aakira/napier/1.4.1/

@4brunu
Copy link
Contributor Author

4brunu commented Mar 23, 2022

Thanks for helping to fix the issue.
Do you know why it's still failing?

@moljac
Copy link
Contributor

moljac commented Mar 23, 2022

Thanks for helping to fix the issue.

NP.

Do you know why it's still failing?

Partially. A lot of dependencies are exact/strict dependencies in form [1.0.1] and for new artifacts you skipped versions causing errors. Yes binderator does not report those and I am adding some logging info for the future use. (I work on new tooling, but have not enough time to continue).

We'll need few rounds of updates for this one and I'll need your help after I untangle all mess.

@4brunu
Copy link
Contributor Author

4brunu commented Mar 23, 2022

Thanks, do you prefer if I split this big PR into smaller ones?
Or should I leave it like this?

@moljac
Copy link
Contributor

moljac commented Jul 22, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines failed to run 1 pipeline(s).

@moljac
Copy link
Contributor

moljac commented Jul 26, 2022

error

Dependency errors : 1
1
	System.Exception: 
No matching artifact config found for: 
			androidx.activity.activity-ktx:[1.4.0]
to satisfy dependency of: 
			androidx.activity.activity-compose:1.4.0

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.activity",
        "artifactId": "activity-ktx",
        "version": "[1.4.0]",
        "nugetVersion": "CHECK PREFIX [1.4.0]",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }

@4brunu
Copy link
Contributor Author

4brunu commented Jul 26, 2022

@moljac the androidx.activity:activity-ktx was present but it was duplicated.
I removed the duplication in c8df489.
Maybe this was the issue?
Let's see if CI passes.

@4brunu
Copy link
Contributor Author

4brunu commented Jul 26, 2022

CI is still failing.
@moljac could you please check what the error is now?
Thanks

config.json Outdated
Comment on lines 1789 to 1828
{
"groupId": "com.google.guava",
"artifactId": "failureaccess",
"version": "1.0.1",
"nugetVersion": "1.0.1.5",
"nugetId": "Xamarin.Google.Guava.FailureAccess",
"dependencyOnly": true
},
{
"groupId": "com.google.guava",
"artifactId": "guava",
"version": "29.0.0",
"nugetVersion": "29.0.0",
"nugetId": "Xamarin.Google.Guava",
"dependencyOnly": true
},
{
"groupId": "com.google.guava",
"artifactId": "listenablefuture",
"version": "1.0",
"nugetVersion": "1.0.0.5",
"nugetId": "Xamarin.Google.Guava.ListenableFuture",
"dependencyOnly": true
},
{
"groupId": "androidx.lifecycle",
"artifactId": "lifecycle-viewmodel-ktx",
"version": "2.3.0",
"nugetVersion": "2.3.1.3",
"nugetId": "Xamarin.AndroidX.Lifecycle.ViewModel.Ktx",
"dependencyOnly": true
},
{
"groupId": "androidx.compose.ui",
"artifactId": "ui",
"version": "1.0.0",
"nugetVersion": "1.0.0",
"nugetId": "Xamarin.AndroidX.Compose.UI",
"dependencyOnly": true
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@moljac all of those are duplicated in config.json.
Is this a bug?
First they are declare with dependencyOnly to false, and then to true.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think those are duplicated, so I remove them here d99ef0a

@moljac
Copy link
Contributor

moljac commented Aug 6, 2022

ups

neverending story




5
	System.Exception: 
No matching artifact config found for: 
			androidx.lifecycle.lifecycle-viewmodel-ktx:[2.5.0]
to satisfy dependency of: 
			androidx.lifecycle.lifecycle-viewmodel-compose:2.5.0

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.lifecycle",
        "artifactId": "lifecycle-viewmodel-ktx",
        "version": "[2.5.0]",
        "nugetVersion": "CHECK PREFIX [2.5.0]",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }
						


6
	System.Exception: 
No matching artifact config found for: 
			androidx.lifecycle.lifecycle-viewmodel-savedstate:[2.5.0]
to satisfy dependency of: 
			androidx.lifecycle.lifecycle-viewmodel-compose:2.5.0

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.lifecycle",
        "artifactId": "lifecycle-viewmodel-savedstate",
        "version": "[2.5.0]",
        "nugetVersion": "CHECK PREFIX [2.5.0]",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }
					

hopefully last change

@moljac
Copy link
Contributor

moljac commented Aug 6, 2022

OMG another round

Dependency errors : 23
1
	System.Exception: 
No matching artifact config found for: 
			androidx.lifecycle.lifecycle-viewmodel-savedstate:2.5.1
to satisfy dependency of: 
			androidx.activity.activity:1.5.1

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.lifecycle",
        "artifactId": "lifecycle-viewmodel-savedstate",
        "version": "2.5.1",
        "nugetVersion": "CHECK PREFIX 2.5.1",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }
						


2
	System.Exception: 
No matching artifact config found for: 
			androidx.activity.activity:[1.5.0]
to satisfy dependency of: 
			androidx.activity.activity-ktx:1.5.0

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.activity",
        "artifactId": "activity",
        "version": "[1.5.0]",
        "nugetVersion": "CHECK PREFIX [1.5.0]",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }
						


3
	System.Exception: 
Artifact
	androidx.compose.animation.animation-core:1.2.0
has unknown 'Runtime' dependency 
	androidx.compose.ui.ui:1.2.0
Either fulfill or exclude this dependency.

4
	System.Exception: 
No matching artifact config found for: 
			androidx.compose.ui.ui:1.2.0
to satisfy dependency of: 
			androidx.compose.foundation.foundation:1.2.0

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.compose.ui",
        "artifactId": "ui",
        "version": "1.2.0",
        "nugetVersion": "CHECK PREFIX 1.2.0",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }
						


5
	System.Exception: 
No matching artifact config found for: 
			androidx.compose.ui.ui:1.2.0
to satisfy dependency of: 
			androidx.compose.foundation.foundation-layout:1.2.0

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.compose.ui",
        "artifactId": "ui",
        "version": "1.2.0",
        "nugetVersion": "CHECK PREFIX 1.2.0",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }
						


6
	System.Exception: 
No matching artifact config found for: 
			androidx.compose.ui.ui:1.2.0
to satisfy dependency of: 
			androidx.compose.material.material:1.2.0

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.compose.ui",
        "artifactId": "ui",
        "version": "1.2.0",
        "nugetVersion": "CHECK PREFIX 1.2.0",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }
						


7
	System.Exception: 
No matching artifact config found for: 
			androidx.compose.ui.ui-geometry:[1.1.1]
to satisfy dependency of: 
			androidx.compose.ui.ui:1.1.1

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.compose.ui",
        "artifactId": "ui-geometry",
        "version": "[1.1.1]",
        "nugetVersion": "CHECK PREFIX [1.1.1]",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }
						


8
	System.Exception: 
No matching artifact config found for: 
			androidx.compose.ui.ui-graphics:[1.1.1]
to satisfy dependency of: 
			androidx.compose.ui.ui:1.1.1

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.compose.ui",
        "artifactId": "ui-graphics",
        "version": "[1.1.1]",
        "nugetVersion": "CHECK PREFIX [1.1.1]",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }
						


9
	System.Exception: 
No matching artifact config found for: 
			androidx.compose.ui.ui-text:[1.1.1]
to satisfy dependency of: 
			androidx.compose.ui.ui:1.1.1

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.compose.ui",
        "artifactId": "ui-text",
        "version": "[1.1.1]",
        "nugetVersion": "CHECK PREFIX [1.1.1]",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }
						


10
	System.Exception: 
No matching artifact config found for: 
			androidx.compose.ui.ui-unit:[1.1.1]
to satisfy dependency of: 
			androidx.compose.ui.ui:1.1.1

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.compose.ui",
        "artifactId": "ui-unit",
        "version": "[1.1.1]",
        "nugetVersion": "CHECK PREFIX [1.1.1]",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }
						


11
	System.Exception: 
Artifact
	androidx.compose.ui.ui:1.1.1
has unknown 'Runtime' dependency 
	androidx.compose.ui.ui-util:[1.1.1]
Either fulfill or exclude this dependency.

12
	System.Exception: 
Artifact
	androidx.compose.ui.ui-viewbinding:1.2.0
has unknown 'Runtime' dependency 
	androidx.compose.ui.ui:[1.2.0]
Either fulfill or exclude this dependency.

13
	System.Exception: 
No matching artifact config found for: 
			androidx.lifecycle.lifecycle-viewmodel-savedstate:2.5.1
to satisfy dependency of: 
			androidx.fragment.fragment:1.5.1

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.lifecycle",
        "artifactId": "lifecycle-viewmodel-savedstate",
        "version": "2.5.1",
        "nugetVersion": "CHECK PREFIX 2.5.1",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }
						


14
	System.Exception: 
No matching artifact config found for: 
			androidx.activity.activity-ktx:1.5.1
to satisfy dependency of: 
			androidx.fragment.fragment-ktx:1.5.1

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.activity",
        "artifactId": "activity-ktx",
        "version": "1.5.1",
        "nugetVersion": "CHECK PREFIX 1.5.1",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }
						


15
	System.Exception: 
No matching artifact config found for: 
			androidx.lifecycle.lifecycle-viewmodel-ktx:2.5.1
to satisfy dependency of: 
			androidx.fragment.fragment-ktx:1.5.1

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.lifecycle",
        "artifactId": "lifecycle-viewmodel-ktx",
        "version": "2.5.1",
        "nugetVersion": "CHECK PREFIX 2.5.1",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }
						


16
	System.Exception: 
No matching artifact config found for: 
			androidx.lifecycle.lifecycle-common:[2.5.0]
to satisfy dependency of: 
			androidx.lifecycle.lifecycle-common-java8:2.5.0

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.lifecycle",
        "artifactId": "lifecycle-common",
        "version": "[2.5.0]",
        "nugetVersion": "CHECK PREFIX [2.5.0]",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }
						


17
	System.Exception: 
No matching artifact config found for: 
			androidx.lifecycle.lifecycle-viewmodel:[2.5.0]
to satisfy dependency of: 
			androidx.lifecycle.lifecycle-viewmodel-ktx:2.5.0

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.lifecycle",
        "artifactId": "lifecycle-viewmodel",
        "version": "[2.5.0]",
        "nugetVersion": "CHECK PREFIX [2.5.0]",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }
						


18
	System.Exception: 
No matching artifact config found for: 
			androidx.lifecycle.lifecycle-livedata-core:[2.5.0]
to satisfy dependency of: 
			androidx.lifecycle.lifecycle-viewmodel-savedstate:2.5.0

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.lifecycle",
        "artifactId": "lifecycle-livedata-core",
        "version": "[2.5.0]",
        "nugetVersion": "CHECK PREFIX [2.5.0]",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }
						


19
	System.Exception: 
No matching artifact config found for: 
			androidx.lifecycle.lifecycle-viewmodel:[2.5.0]
to satisfy dependency of: 
			androidx.lifecycle.lifecycle-viewmodel-savedstate:2.5.0

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.lifecycle",
        "artifactId": "lifecycle-viewmodel",
        "version": "[2.5.0]",
        "nugetVersion": "CHECK PREFIX [2.5.0]",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }
						


20
	System.Exception: 
No matching artifact config found for: 
			androidx.lifecycle.lifecycle-viewmodel-ktx:2.5.1
to satisfy dependency of: 
			androidx.navigation.navigation-common:2.5.1

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.lifecycle",
        "artifactId": "lifecycle-viewmodel-ktx",
        "version": "2.5.1",
        "nugetVersion": "CHECK PREFIX 2.5.1",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }
						


21
	System.Exception: 
No matching artifact config found for: 
			androidx.lifecycle.lifecycle-viewmodel-savedstate:2.5.1
to satisfy dependency of: 
			androidx.navigation.navigation-common:2.5.1

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.lifecycle",
        "artifactId": "lifecycle-viewmodel-savedstate",
        "version": "2.5.1",
        "nugetVersion": "CHECK PREFIX 2.5.1",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }
						


22
	System.Exception: 
No matching artifact config found for: 
			androidx.activity.activity-ktx:1.5.1
to satisfy dependency of: 
			androidx.navigation.navigation-runtime:2.5.1

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.activity",
        "artifactId": "activity-ktx",
        "version": "1.5.1",
        "nugetVersion": "CHECK PREFIX 1.5.1",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }
						


23
	System.Exception: 
No matching artifact config found for: 
			androidx.lifecycle.lifecycle-viewmodel-ktx:2.5.1
to satisfy dependency of: 
			androidx.navigation.navigation-runtime:2.5.1

	Please add following json snippet to config.json:


      {
        "groupId": "androidx.lifecycle",
        "artifactId": "lifecycle-viewmodel-ktx",
        "version": "2.5.1",
        "nugetVersion": "CHECK PREFIX 2.5.1",
        "nugetId": "CHECK NUGET ID",
        "dependencyOnly": true/false
      }

@moljac moljac merged commit f6549ae into dotnet:main Aug 6, 2022
@4brunu
Copy link
Contributor Author

4brunu commented Aug 6, 2022

@moljac thank you so much for you effort in merging this PR, this is a very important step for the future of android development 👍

@moljac
Copy link
Contributor

moljac commented Aug 6, 2022

@moljac thank you so much for you effort in merging this PR, this is a very important step for the future of android development 👍

sorry for not being reviewed and merged earlier. There was tons of other stuff with higher priorities, then some blocking stuff, etc...

BTW if you can create some samples and show me/us, so we can integrate those into tests - that would be great

@4brunu 4brunu deleted the feature/more-compose-stable-packages branch August 8, 2022 09:58
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