首页 > 解决方案 > 如何将 Xamarin Android 绑定限制为仅特定包

问题描述

有没有办法对白名单进行排序,只转换特定类型的绑定并忽略所有其他符号?更具体地说,在 c# 中我们需要与 5-6 种类型进行交互,其余的由 java aar 处理,我们不关心它。这样,生成器就不需要担心 lib 的其余部分,我们的绑定库实际上变得更简单了。

需要明确的是,我知道您可以删除节点,但您是每个节点的临时成员。我希望删除所有节点,只添加我们需要的极少数节点。

我正在为第三方 aar 创建 Xamarin Android 绑定。看起来 aar 基于 classes.jar 将其所有依赖项打包到 aar 中。但是,xamarin 绑定生成器对转换 aar 依赖项感到不满。我们尝试使用 pom 文件来获取 aar 的所有依赖项并将它们附加为嵌入式参考 jar,但这不起作用。此外,图书馆依赖于三个 aars。基于https://bugzilla.xamarin.com/show_bug.cgi?id=44573看来我们不能在绑定库中引用多个 aar。安息吧。

这是我们从绑定生成器中得到的错误片段:

Error while processing '[Method] java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal temporal, long newValue)' in '[Class] java.time.temporal.ChronoField': Type 'java.time.temporal.Temporal' was not found.
Error while processing '[Method] java.time.temporal.Temporal addTo(java.time.temporal.Temporal temporal, long amount)' in '[Class] java.time.temporal.ChronoUnit': Type 'java.time.temporal.Temporal' was not found.
Error while processing type '[Class] a.a.d.n.a': Type 'io.reactivex.functions.Consumer' was not found.
Error while processing '[Method] T a<T>(io.reactivex.Observable<T> p0)' in '[Class] a.a.d.n.b': Type 'io.reactivex.Observable' was not found.
Error while processing type '[Class] a.a.f.a.a': Type 'com.google.android.gms.location.FusedLocationProviderClient' was not found.
Error while processing '[Method] io.reactivex.CompletableObserver a(boolean p0)' in '[Class] a.a.h.a': Type 'io.reactivex.CompletableObserver' was not found.
Error while processing type '[Class] a.a.h.a.a': Type 'io.reactivex.CompletableObserver' was not found.
Error while processing '[Method] io.reactivex.Observable<java.lang.Boolean> b()' in '[Class] a.a.i.a.c': Type 'io.reactivex.Observable' was not found.
Error while processing '[Method] io.reactivex.Observable<java.lang.Boolean> b()' in '[Class] a.a.i.a.d': Type 'io.reactivex.Observable' was not found.
Error while processing '[Constructor] A.a(kotlin.jvm.internal.DefaultConstructorMarker p0)' in '[Class] a.a.i.b.e.A.a': Type 'kotlin.jvm.internal.DefaultConstructorMarker' was not found.
Error while processing '[Constructor] h.a(kotlin.jvm.internal.DefaultConstructorMarker p0)' in '[Class] a.a.i.b.e.h.a': Type 'kotlin.jvm.internal.DefaultConstructorMarker' was not found.
Error while processing '[Constructor] j.a(kotlin.jvm.internal.DefaultConstructorMarker p0)' in '[Class] a.a.i.b.e.j.a': Type 'kotlin.jvm.internal.DefaultConstructorMarker' was not found.
Error while processing '[Method] io.reactivex.Observable<a.a.i.b.e.j> a()' in '[Class] a.a.i.b.e.k': Type 'io.reactivex.Observable' was not found.
Error while processing type '[Class] a.a.i.b.e.k.b': Type 'io.reactivex.functions.BiFunction' was not found.
Error while processing '[Constructor] k.c(kotlin.jvm.internal.DefaultConstructorMarker p0)' in '[Class] a.a.i.b.e.k.c': Type 'kotlin.jvm.internal.DefaultConstructorMarker' was not found.
Error while processing '[Method] io.reactivex.Observable<a.a.i.b.e.j> a()' in '[Class] a.a.i.b.e.o': Type 'io.reactivex.Observable' was not found.
Error while processing '[Method] io.reactivex.Observable<a.a.i.b.e.j> a()' in '[Class] a.a.i.b.e.u': Type 'io.reactivex.Observable' was not found.
Error while processing type '[Class] a.a.i.b.e.u.b': Type 'io.reactivex.functions.BiFunction' was not found.
Error while processing type '[Class] a.a.i.b.e.u.c': Type 'io.reactivex.functions.Consumer' was not found.
Error while processing '[Constructor] c.a(kotlin.jvm.internal.DefaultConstructorMarker p0)' in '[Class] a.a.i.b.e.B.c.a': Type 'kotlin.jvm.internal.DefaultConstructorMarker' was not found.
Error while processing '[Constructor] d.a(kotlin.jvm.internal.DefaultConstructorMarker p0)' in '[Class] a.a.i.b.e.B.d.a': Type 'kotlin.jvm.internal.DefaultConstructorMarker' was not found.
Error while processing '[Constructor] e.a.a(kotlin.jvm.internal.DefaultConstructorMarker p0)' in '[Class] a.a.i.b.e.B.e.a.a': Type 'kotlin.jvm.internal.DefaultConstructorMarker' was not found.
Error while processing type '[Class] a.a.i.b.e.B.e.b.a': Type 'io.reactivex.SingleObserver' was not found.
Error while processing '[Constructor] g.a(kotlin.jvm.internal.DefaultConstructorMarker p0)' in '[Class] a.a.i.b.e.B.g.a': Type 'kotlin.jvm.internal.DefaultConstructorMarker' was not found.
Error while processing type '[Class] a.a.i.c.a.a': Type 'io.reactivex.Observer' was not found.
Error while processing '[Method] io.reactivex.Observable<java.lang.Boolean> b()' in '[Class] a.a.i.d.h': Type 'io.reactivex.Observable' was not found.
Error while processing '[Method] io.reactivex.Observable<java.lang.Boolean> b()' in '[Class] a.a.i.d.i': Type 'io.reactivex.Observable' was not found.
Error while processing type '[Class] a.a.i.d.i.a': Type 'io.reactivex.Observer' was not found.
Error while processing type '[Class] a.a.i.d.i.b': Type 'io.reactivex.functions.Action' was not found.
Error while processing type '[Class] a.a.i.d.i.c': Type 'io.reactivex.functions.Consumer' was not found.
Error while processing '[Constructor] B(a.a.k.z.b p0, int p1, kotlin.jvm.internal.DefaultConstructorMarker p2)' in '[Class] a.a.k.A.B': Type 'kotlin.jvm.internal.DefaultConstructorMarker' was not found.
Error while processing '[Method] void a(a.a.k.A.B.a p0, kotlinx.serialization.CompositeEncoder p1, kotlinx.serialization.SerialDescriptor p2)' in '[Class] a.a.k.A.B.a': Type 'kotlinx.serialization.CompositeEncoder' was not found.
Error while processing '[Constructor] B.a(int p0, java.util.List<a.a.k.A.X.C0> p1, kotlinx.serialization.SerializationConstructorMarker p2)' in '[Class] a.a.k.A.B.a': Type 'kotlinx.serialization.SerializationConstructorMarker' was not found.
Error while processing type '[Class] a.a.k.A.B.a.a': Type 'kotlinx.serialization.internal.GeneratedSerializer' was not found.
Error while processing '[Method] kotlinx.serialization.KSerializer<a.a.k.A.B.a> a()' in '[Class] a.a.k.A.B.a.b': Type 'kotlinx.serialization.KSerializer' was not found.
Error while processing '[Constructor] B.a.b(kotlin.jvm.internal.DefaultConstructorMarker p0)' in '[Class] a.a.k.A.B.a.b': Type 'kotlin.jvm.internal.DefaultConstructorMarker' was not found.
Error while processing type '[Class] a.a.k.A.c': Type 'kotlinx.serialization.KSerializer' was not found.
Error while processing type '[Class] a.a.k.A.d.a': Type 'io.reactivex.functions.Consumer' was not found.
Error while processing type '[Class] a.a.k.A.d.b': Type 'io.reactivex.observers.DisposableObserver' was not found.
Error while processing type '[Class] a.a.k.A.d.c': Type 'io.reactivex.observers.DisposableObserver' was not found.
Error while processing type '[Class] a.a.k.A.f': Type 'kotlinx.serialization.KSerializer' was not found.
Error while processing '[Method] io.reactivex.functions.Function<org.json.JSONObject, org.json.JSONObject> a(java.lang.String... p0)' in '[Class] a.a.k.A.G': Type 'io.reactivex.functions.Function' was not found.
Error while processing type '[Class] a.a.k.A.G.a': Type 'io.reactivex.functions.Function' was not found.
Error while processing '[Method] io.reactivex.Completable a()' in '[Class] a.a.k.A.j': Type 'io.reactivex.Completable' was not found.
Error while processing '[Method] io.reactivex.Completable a(io.reactivex.Single<org.json.JSONObject> p0)' in '[Class] a.a.k.A.j': Type 'io.reactivex.Single' was not found.
Error while processing '[Method] void a(io.reactivex.subjects.CompletableSubject p0, java.lang.Throwable p1)' in '[Class] a.a.k.A.j': Type 'io.reactivex.subjects.CompletableSubject' was not found.
Error while processing '[Method] void a(io.reactivex.subjects.CompletableSubject p0, org.json.JSONObject p1)' in '[Class] a.a.k.A.j': Type 'io.reactivex.subjects.CompletableSubject' was not found.
Error while processing '[Method] io.reactivex.Completable b()' in '[Class] a.a.k.A.j': Type 'io.reactivex.Completable' was not found.
Error while processing type '[Class] a.a.k.A.j.a': Type 'io.reactivex.functions.Action' was not found.
Error while processing type '[Class] a.a.k.A.j.b': Type 'io.reactivex.functions.Consumer' was not found.
Error while processing type '[Class] a.a.k.A.j.c': Type 'io.reactivex.SingleObserver' was not found.
Error while processing type '[Class] a.a.k.A.j.d': Type 'io.reactivex.CompletableObserver' was not found.
Error while processing '[Method] io.reactivex.Completable a()' in '[Class] a.a.k.A.j.e': Type 'io.reactivex.Completable' was not found.
Error while processing '[Method] io.reactivex.Completable a(org.json.JSONObject p0)' in '[Class] a.a.k.A.j.e': Type 'io.reactivex.Completable' was not found.
Error while processing '[Method] io.reactivex.Completable b()' in '[Class] a.a.k.A.j.e': Type 'io.reactivex.Completable' was not found.
Error while processing type '[Class] a.a.k.A.j.e.b': Type 'io.reactivex.CompletableOnSubscribe' was not found.
Error while processing type '[Class] a.a.k.A.j.e.c': Type 'io.reactivex.CompletableOnSubscribe' was not found.
Error while processing type '[Class] a.a.k.A.j.e.d': Type 'io.reactivex.Completable' was not found.
Error while processing '[Method] io.reactivex.Single<java.lang.Boolean> a()' in '[Class] a.a.k.A.l': Type 'io.reactivex.Single' was not found.
Error while processing type '[Class] a.a.k.A.l.a': Type 'T' was not found.
Error while processing '[Method] io.reactivex.Single<java.lang.Boolean> a()' in '[Class] a.a.k.A.M': Type 'io.reactivex.Single' was not found.
Error while processing '[Method] io.reactivex.Single<java.lang.Boolean> d()' in '[Class] a.a.k.A.M': Type 'io.reactivex.Single' was not found.
Error while processing '[Constructor] p.a(kotlin.jvm.internal.DefaultConstructorMarker p0)' in '[Class] a.a.k.A.p.a': Type 'kotlin.jvm.internal.DefaultConstructorMarker' was not found.
Error while processing '[Constructor] P.a(kotlin.jvm.internal.DefaultConstructorMarker p0)' in '[Class] a.a.k.A.P.a': Type 'kotlin.jvm.internal.DefaultConstructorMarker' was not found.
Error while processing type '[Class] a.a.k.A.s.a': Type 'io.reactivex.functions.Action' was not found.
Error while processing type '[Class] a.a.k.A.s.b': Type 'io.reactivex.ObservableOnSubscribe' was not found.
Error while processing type '[Class] a.a.k.A.s.c': Type 'io.reactivex.functions.Action' was not found.
Error while processing type '[Class] a.a.k.A.s.d': Type 'io.reactivex.ObservableOnSubscribe' was not found.
Error while processing '[Method] io.reactivex.Single<java.lang.Boolean> d()' in '[Class] a.a.k.A.T': Type 'io.reactivex.Single' was not found.
Error while processing type '[Class] a.a.k.A.T.a': Type 'T' was not found.
Error while processing '[Method] void a(io.reactivex.Single<org.json.JSONObject> p0)' in '[Class] a.a.k.A.v': Type 'io.reactivex.Single' was not found.
Error while processing type '[Class] a.a.k.A.v.a': Type 'io.reactivex.CompletableObserver' was not found.
Error while processing type '[Class] a.a.k.A.v.b': Type 'io.reactivex.CompletableObserver' was not found.
Error while processing type '[Class] a.a.k.A.v.c': Type 'io.reactivex.CompletableObserver' was not found.
Error while processing '[Method] java.util.List<androidx.core.util.Pair<a.a.k.A.U.b, a.a.k.A.U.c.a>> a(a.a.k.A.U.c p0)' in '[Class] a.a.k.A.U.d': Type 'androidx.core.util.Pair' was not found.
Error while processing '[Method] java.util.List<androidx.core.util.Pair<a.a.k.A.U.b, a.a.k.A.U.c.a>> a(a.a.k.A.U.c p0)' in '[Class] a.a.k.A.U.f.b': Type 'androidx.core.util.Pair' was not found.
Error while processing '[Method] io.reactivex.Observable<java.lang.Boolean> j()' in '[Class] a.a.k.A.V.l': Type 'io.reactivex.Observable' was not found.
Error while processing type '[Class] a.a.k.A.V.l.a': Type 'io.reactivex.observers.DisposableCompletableObserver' was not found.
Error while processing type '[Class] a.a.k.A.V.m.a.a': Type 'io.reactivex.functions.BiConsumer' was not found.
Error while processing type '[Class] a.a.k.A.V.m.a.b': Type 'io.reactivex.SingleOnSubscribe' was not found.
Error while processing '[Method] io.reactivex.Completable a(a.a.k.A.V.c p0)' in '[Class] a.a.k.A.V.n.b': Type 'io.reactivex.Completable' was not found.
Error while processing type '[Class] a.a.k.A.V.n.b.a': Type 'io.reactivex.functions.Consumer' was not found.
Error while processing type '[Class] a.a.k.A.V.n.b.b': Type 'io.reactivex.functions.Action' was not found.
Error while processing type '[Class] a.a.k.A.V.n.b.c': Type 'io.reactivex.functions.Function' was not found.
Error while processing type '[Class] a.a.k.A.V.n.b.d': Type 'io.reactivex.functions.Function' was not found.
Error while processing type '[Class] a.a.k.A.V.n.b.e': Type 'io.reactivex.functions.Consumer' was not found.
Error while processing type '[Class] a.a.k.A.V.n.b.f': Type 'io.reactivex.functions.Function' was not found.
Error while processing type '[Class] a.a.k.A.V.n.b.g': Type 'io.reactivex.functions.Function' was not found.
Error while processing type '[Class] a.a.k.A.V.n.b.h': Type 'io.reactivex.functions.Consumer' was not found.
Error while processing type '[Class] a.a.k.A.V.n.b.i': Type 'io.reactivex.functions.Function' was not found.
Error while processing type '[Class] a.a.k.A.V.n.b.j': Type 'io.reactivex.functions.Function' was not found.

标签: c#kotlinxamarin.android

解决方案


推荐阅读