-
Notifications
You must be signed in to change notification settings - Fork 537
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
Import proguard rules from proguard-android.txt #8403
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1940,7 +1940,6 @@ because xbuild doesn't support framework reference assemblies. | |||
<_ProguardConfiguration Include="$(ProguardConfigFiles)" /> | |||
</ItemGroup> | |||
<ItemGroup Condition=" '$(ProguardConfigFiles)' == '' "> | |||
<_ProguardConfiguration Include="$(_AndroidSdkDirectory)tools\proguard\proguard-android.txt" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, removing this really broke the LibraryProjectZipWithLint
test. Is there a real issue there?
While I think this is a good change, I'm not convinced it actually fixes the reported issue. From my testing, this case #8337 (comment) still seems to work on .NET 7 but not .NET 8. I keep investigating but I cannot find any real difference between the 2 that would cause the issue. |
As per discussion on Discord, it looks like dotnet/java-interop#1149 is the actual fix for #8337. We may still want this change anyway, but we should probably re-evaluate this. Why did Google remove I suspect that this will become a .NET 9 task. |
I came across the answer to this earlier in my research:
(Source) Agreed that this is something we will eventually need to further research to ensure we keep up with the Android ecosystem. |
Context dotnet#8337 dotnet#8397 The latest Android sdk no longer ships with `proguard` as a result the file in proguard-android.txt [1] is missing. As a result customers are reporting errors such as ``` Unhandled Exception from source=AndroidEnvironment Java.Lang.Exception: android.view.View_IOnClickListenerImplementor at Java.Interop.JniEnvironment.Types.TryFindClass(String , Boolean ) at Java.Interop.JniEnvironment.Types.FindClass(String ) at Java.Interop.JniType..ctor(String ) at Java.Interop.JniPeerMembers.JniInstanceMethods..ctor(Type ) at Java.Interop.JniPeerMembers.JniInstanceMethods.GetConstructorsForType(Type ) at Java.Interop.JniPeerMembers.JniInstanceMethods.StartCreateInstance(String , Type , JniArgumentValue* ) at Android.Views.View.IOnClickListenerImplementor..ctor() at Android.Views.View.__CreateIOnClickListenerImplementor() at Java.Interop.EventHelper.AddEventHandler[IOnClickListener,IOnClickListenerImplementor](WeakReference& , Func`1 , Action`1 , Action`1 ) at Android.Views.View.add_Click(EventHandler ) at com.glmsoftware.obdnowpros.Fragments.SubscriptionFragment.OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) at AndroidX.Fragment.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_(IntPtr jnienv, IntPtr native__this, IntPtr native_inflater, IntPtr native_container, IntPtr native_savedInstanceState) at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLL_L(_JniMarshal_PPLLL_L callback, IntPtr jnienv, IntPtr klazz, IntPtr p0, IntPtr p1, IntPtr p2) --- End of managed Java.Lang.Exception stack trace --- ``` This is probably because certain code is removed that in the latest version of R8 that used to be left in place. We should include the contents of this removed file in our own proguard_xamarin.cfg file. [1] https://android.googlesource.com/platform/sdk/+/refs/heads/main/files/proguard-android.txt
5e518ed
to
b6e3116
Compare
I'm closing this PR as it was not causing the issue. |
Context: #8337
Fixes: #8397
The latest Android sdk no longer ships with
proguard
as a result the file in proguard-android.txt [1] is missing. As a result customers are reporting errors such asThis is probably because certain code is removed that in the latest version of R8 that used to be left in place.
We should include the contents of this removed file in our own proguard_xamarin.cfg file.
[1] https://android.googlesource.com/platform/sdk/+/refs/heads/main/files/proguard-android.txt