euc-releases / vmware-ws1-sdk-xamarin

VMware Workspace ONE SDK for Xamarin
Other
6 stars 7 forks source link

Builderror in xamarin android #6

Closed JanSteffes closed 4 years ago

JanSteffes commented 4 years ago

I tried to include your nuget package of the newest version (1.4.0.1).

In iOS, where we already had the versions 1.2.2 and 1.3.1 installed, it seems to work just fine. But in android, we get some build errors.

I'm following this documentation , which seems to be the latest that i can find.

After following this documentation and trying to build the project, the following build error appears (real path substituted with , does not include any spaces, same with ): Can't read [<path>\obj\Debug\90\lp\51\jl\__reference__guava.jar(;;;;;;!META-INF/MANIFEST.MF)] (invalid entry size (expected 67324752 but got 2367 bytes)) which can be fixed by updating the Xamarin.Google.Guava package and its dependencies to the latest version (27.1.0.2). Doing so leads then to another error that i can't get rid of: Can't write [C:\Users\<user>\AppData\Local\Temp\upttbndm.mk5.jar] (Can't read [<path>\obj\Debug\90\lp\3\jl\__reference__multidex-1.0.1.jar(;;;;;;!META-INF/MANIFEST.MF)] (Duplicate zip entry [__reference__multidex-1.0.1.jar:android/support/multidex/MultiDex$V14.class]))

It seems like the multidex-1.0.1.jar is used/referenced in the AWFrameworkBindings.dll. I also updated all other packages that had updates available, but it resulted in the same error.

The above was done with Visual Studio 2019. With Visual Studio 2017, it shows an other error: Can't write [C:\Users\\AppData\Local\Temp\cuqrkgux.lxw.jar] (Can't read [\obj\Debug\90\lp\55\jl\kotlin-stdlib.jar(;;;;;;!META-INF/MANIFEST.MF)] (Duplicate zip entry [kotlin-stdlib.jar:kotlin/jvm/internal/Reflection.class]))

The Target Framework Version is Android 9.0 (Pie), the Target android Version is the same and the Minimum Android version is If you need some further information about out project settings, i'm happy to provide them.

JanSteffes commented 4 years ago

After some more digging into it, repairing vs 2019, reinstalling android sdk etc it may be a configuration problem of my machine. A colleague of mine is able to build the project without errors. I'll give updates on this as soon as we have figuared out something more.

Edit: To be more precise, i was able to build the project with an older Version (16.2.3) of VS 2019. It needs some time (around 10 Minutes) but well, at least it builds. Seems like there might be a problem with using the latest Version (16.3.1).

You may mark this issue as closed.

Edit: Spelling error

JanSteffes commented 4 years ago

If anyone else is running into this problem and some others that may be releated like

java/lang/String;)Ljava/util/List;: defining a static interface method requires --min-sdk-version >= 24 (currently 13) for interface methods: okhttp3.Dns.lambda$static$0 : (Ljava/lang/String;)Ljava/util/List

For me, it helped to check the parameters of the sample project build options (in the csproject-file) and substitute mine where they were different.

Maddy79 commented 4 years ago

@JanSteffes , in the sample app new change is merged to fix the multidex duplicate issue.

JanSteffes commented 4 years ago

I'm reoppening this issue because i think a now occuring error might be releated to the above.

I'm not getting any build errors anymore and the application will be installed on the target device. However, it nearly immediatly throws exception which leads to the immidiate closing of the app: Java.Lang.IllegalStateException: 'could not load open ssl'. Now, i wonder, if this occurs because of some configuration problem or if there's still something wrong with my code / project setup. The debug output shows the following: https://pastebin.com/4TPuRvjw

I'm not really into all of the workspace one / airwatch project setup, i'm currently just developing the app which has to integate this sdk. As far as i know and have been told, it's used to access company internal data, among other uses. This means i don't have access or much knowledge of the airwatch "backend" like the console and so on, this is all handled by the customer we develop the app for. To "really" test if the integration worked, the configuration has to be correct, like, the device has to be registered, the app has to be added / whitelisted and so on, but since there's an exception and the sample app doesn't get beyond that, i just want to know if this may be some problem with my project setup or the code or just a configuration issue. I'd be happy if you can help me finding/fixing this error.

I tried updating some nuget packages to see if that helped, but with no successfull result so far. Btw, is there a reason the sample project uses AWSDK V1.4.0 and not AWSDK V1.4.0.1?

Edit: formatting

Maddy79 commented 4 years ago

@JanSteffes , for the app (with AWSDK package) to run without the openssl load crash, the device has to be enrolled to the WorkspaceOne UEM Console and the apk has to be uploaded to the WorkpaceOne console. This is a pre-requisite for the app to work.

1.4.0.1 was a minor update for iOS, should not be an issue for Android.

JanSteffes commented 4 years ago

Thanks for the fast answer. I'll take a look into this then. Thanks for your help so far :)