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

Link assemblies works, but compression doesn't #3399

Closed
FANMixco opened this issue Jul 29, 2019 · 13 comments
Closed

Link assemblies works, but compression doesn't #3399

FANMixco opened this issue Jul 29, 2019 · 13 comments
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects. need-info Issues that need more information from the author.

Comments

@FANMixco
Copy link

FANMixco commented Jul 29, 2019

Steps to Reproduce

  1. Uncompressed this project: https://drive.google.com/open?id=1ka2iNlzrD57aD_3K8Yt7hzfyPlCQNOj0
  2. Choose any compression r8 or proguard (there's already r8 chosen).
  3. Run the application.

Expected Behavior

To run.

Actual Behavior

Crashes.

I get this error:

Screen Shot 2019-07-29 at 19 45 37

Configuration:

Screen Shot 2019-07-29 at 19 47 49

Screen Shot 2019-07-29 at 19 41 32

If you choose no compression then it works properly.

Version Information

Visual Studio Community 2019 for Mac
Version 8.2 (build 1105)
Installation UUID: fbf7c291-8ea2-41dd-916a-6882576d42d1
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 5.14.0.85 (d16-2-fix-mac-updates / 86973979)

Package version: 600000311

Mono Framework MDK
Runtime:
Mono 6.0.0.311 (2019-02/494641b300c) (64-bit)
Package version: 600000311

NuGet
Version: 5.1.0.6013

.NET Core
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
2.1.12
2.1.11
2.1.9
2.1.8
2.1.7
2.1.6
2.1.2
2.1.1
2.0.5
2.0.0
1.1.2
1.0.5
SDK: /usr/local/share/dotnet/sdk/2.1.701/Sdks
SDK Versions:
2.1.701
2.1.700
2.1.505
2.1.504
2.1.503
2.1.500
2.1.302
2.1.301
2.1.4
2.0.0
1.0.4
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.0.0/lib/mono/msbuild/Current/bin/Sdks

Xamarin.Profiler
Version: 1.6.11
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Updater
Version: 11

Xamarin.Android
Version: 9.4.0.51 (Visual Studio Community)
Commit: xamarin-android/d16-2/9fa7775
Android SDK: /Users/fanmixco/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 29.0.1
SDK Build Tools Version: 27.0.3

Build Information:
Mono: mono/mono@e6f5369c2d2
Java.Interop: xamarin/java.interop/d16-2@d64ada5
LibZipSharp: grendello/LibZipSharp/d16-2@caa0c74
LibZip: nih-at/libzip@b95cf3f
ProGuard: xamarin/proguard@905836d
SQLite: xamarin/sqlite@8212a2d
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-2@6f6c969

Microsoft Mobile OpenJDK
Java SDK: /Users/fanmixco/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Android Device Manager
Version: 1.2.0.58
Hash: d03e3ea
Branch: remotes/origin/d16-2~1
Build date: 2019-07-16 17:37:14 UTC

Xamarin Designer
Version: 16.2.0.354
Hash: 5f80a14f8
Branch: remotes/origin/d16-2
Build date: 2019-07-11 17:28:26 UTC

Apple Developer Tools
Xcode 10.3 (14492.2)
Build 10G8

Xamarin.Mac
Version: 5.14.0.110 (Visual Studio Community)
Hash: a8bcecce
Branch: d16-2
Build date: 2019-06-28 07:31:43-0400

Xamarin.iOS
Version: 12.14.0.110 (Visual Studio Community)
Hash: a8bcecce
Branch: d16-2
Build date: 2019-06-28 07:31:42-0400

Xamarin Inspector
Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1

Build Information
Release ID: 802001105
Git revision: a187f6852ae62ba52b944b47e53702957edfcf7b
Build date: 2019-07-22 18:20:10+00
Build branch: release-8.2
Xamarin extensions: 34bd2378d8d707df25989727c23ce68d9a232a67

Operating System
Mac OS X 10.14.5
Darwin 18.6.0 Darwin Kernel Version 18.6.0
Thu Apr 25 23:16:27 PDT 2019
root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64

Log File

@EmilAlipiev
Copy link

I think that you should post this question on xamarin forums. It is your project specific error. In general compression works fine. If you believe that it doesnt you should attach log information you receive. Also please try to attach projects in zip format directly instead of providing gdrive url

@FANMixco
Copy link
Author

I think that you should post this question on xamarin forums. It is your project specific error. In general compression works fine. If you believe that it doesnt you should attach log information you receive. Also please try to attach projects in zip format directly instead of providing gdrive url

No one has complained before from the Xamarin Team about the GDrive URLs, also, I didn't know I can drop files here. Second, the Forum is very vague and hardly ever I get any answer to my problems since I have raised many. Also, this is an issue. How am I going to know the error if the app only crashes when I do what I said and run it? It just crashes, if I deactivate the compression it works.

@EmilAlipiev
Copy link

in the forum there are xamarin certified developers and xamarin employees they check topics regularly (i do myself also) but if you post like you posted here, nobody will reply you.

  • You should give information, what you have done.
  • What error you get.
  • Provide minimal logs from your ouput window of VS.
    if you dont have time to post proper information, sorry but people also dont have time.
    Your issue is a kind of beginner issue in its own category, you should go through the documentation and ask question or problems in the forum.
    here should be addressed only bug reports and feature requests. Otherwise there are real bugs there preventing our work and business schedule, among 366 open issues, they will be delayed.
    Regarding your problem, I dont see any proguard.cfg in your project. without this file, compression wont work. I didnt download your project because its 150 mb size, you should clean your bin, obj folders for each project and nuget folder as well before you post it.

@FANMixco
Copy link
Author

FANMixco commented Jul 29, 2019

in the forum there are xamarin certified developers and xamarin employees they check topics regularly (i do myself also) but if you post like you posted here, nobody will reply you.

  • You should give information, what you have done.
  • What error you get.
  • Provide minimal logs from your ouput window of VS.
    if you dont have time to post proper information, sorry but people also dont have time.
    Your issue is a kind of beginner issue in its own category, you should go through the documentation and ask question or problems in the forum.
    here should be addressed only bug reports and feature requests. Otherwise there are real bugs there preventing our work and business schedule, among 366 open issues, they will be delayed.
    Regarding your problem, I dont see any proguard.cfg in your project. without this file, compression wont work. I didnt download your project because its 150 mb size, you should clean your bin, obj folders for each project and nuget folder as well before you post it.

Well, let's start by something, I'm not new here and I know about reporting bugs as getting support if you could answer my Xamarin.Android questions in the forum, it would be awesome since I've been waiting for someone who could give me some light, I asked the same questions in StackOverflow too, but if you could support me, you would do me a great favor.

I have reported the questions and they are even accepted by Microsoft as a bugs, let's consider this one:

#3263

Therefore, I know how to differentiate between a Bug and a possible mistake from my side. Now, the second point, the project is huge and yes it's 150MB and it's not connected to NuGets, Bins or Objs. There are no bins and objs folders if you see it carefully, I know very well that I need to delete them frequently since they cause several issues.

Next, I know what is proguard since I have enabled it and disabled it many times and this is the first time that the compiler is crashing, how do I know it that's a bug? Because I have built 3 editions of this project with VS2015, VS2017 and VS2019 and only in the latest iteration with VS2019, I have had multiple bugs that I have reported in VS support, Xamarin Forums and here.

@EmilAlipiev
Copy link

because in your previous bug report, you have more details and valid point that something was working. no i didnt look detailed into your sample project because many of us will ignore 150mb of project. thats why Xamarin team always says minimal repro!
You arent giving any details of what is crashing. what error you get. how should we know? you may add a google library or facebook nuget since your last try and when you enable proguard, it will strip off many functions and classes, variables. so you bump into a crash. Without proper proguard config, you can never get proguard or d8/r8 working.

@FANMixco
Copy link
Author

because in your previous bug report, you have more details and valid point that something was working. no i didnt look detailed into your sample project because many of us will ignore 150mb of project. thats why Xamarin team always says minimal repro!
You arent giving any details of what is crashing. what error you get. how should we know? you may add a google library or facebook nuget since your last try and when you enable proguard, it will strip off many functions and classes, variables. so you bump into a crash. Without proper proguard config, you can never get proguard or d8/r8 working.

I added the rest of details including a new project, but it still crashes in the configuration that I said.

@pjcollins
Copy link
Member

@FANMixco I think you'll need to add a custom proguard config file to your app to ensure certain types required at start up are present in the main dex file. For more information, please see these docs:

https://docs.microsoft.com/en-us/xamarin/android/deploy-test/release-prep/proguard?tabs=windows#customizing-proguard

These proguard config files should still be used when r8 is enabled.

@FANMixco
Copy link
Author

FANMixco commented Jul 30, 2019

@FANMixco I think you'll need to add a custom proguard config file to your app to ensure certain types required at start up are present in the main dex file. For more information, please see these docs:

https://docs.microsoft.com/en-us/xamarin/android/deploy-test/release-prep/proguard?tabs=windows#customizing-proguard

These proguard config files should still be used when r8 is enabled.

It crashes.

Screen Shot 2019-07-30 at 21 07 05

Screen Shot 2019-07-30 at 21 09 02

Screen Shot 2019-07-30 at 21 15 11

Screen Shot 2019-07-30 at 21 07 53

@pjcollins
Copy link
Member

The first screenshot looks like a build error, not a runtime crash? It's hard to tell what's going wrong just from these few screen shots. I don't think the Preserve attribute should be needed in this case.

@FANMixco
Copy link
Author

FANMixco commented Aug 1, 2019

The first screenshot looks like a build error, not a runtime crash? It's hard to tell what's going wrong just from these few screen shots. I don't think the Preserve attribute should be needed in this case.

The last of the preserve can be ignored, however, the error yes, it's not runtime, but the Java heap looks irrelevant and if remove the proguard file then it creates the APK, but it doesn't work.

@jonathanpeppers jonathanpeppers self-assigned this Jun 22, 2022
@jonathanpeppers jonathanpeppers added the Area: App+Library Build Issues when building Library projects or Application projects. label Jun 22, 2022
@jonathanpeppers
Copy link
Member

@FANMixco I think this problem may have been fixed by: #6957

Previously, we weren't getting aapt2 to output the list of proguard rules that would be needed in any .xml layout, etc. And so you would get an error like FitWindowsLinearLayout being removed.

If you use the latest Xamarin.Android, does this problem still occur? Thanks!

@jonathanpeppers jonathanpeppers added the need-info Issues that need more information from the author. label Jun 22, 2022
@ghost
Copy link

ghost commented Jun 22, 2022

Hi @FANMixco. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@FANMixco
Copy link
Author

Hi @jonathanpeppers, considering that it has been 3 years since it was opened. I'm going to close it.

@ghost ghost locked as resolved and limited conversation to collaborators Jul 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: App+Library Build Issues when building Library projects or Application projects. need-info Issues that need more information from the author.
Projects
None yet
Development

No branches or pull requests

4 participants