Visual Studio 16.3.2 Unexpected Element Activity RRS feed

  • Question

  • User381037 posted

    I have an app developed using XF and VS2019. Everything was working fine form compile and publish until 16.3.2 Visual Studio upgrade. I am using Google Ads implemented using Marctron.Admob, which seems to be the source of this problem in some way. The line that it is triggering on is <application android:label="NYWineryHopper.Android" android:icon="@drawable/icon" android:name="android.support.multidex.MultiDexApplication" android:allowBackup="true" android:debuggable="true"> Has anyone experienced issues with an upgrade to the latest VS and XF versions?

    Tuesday, October 8, 2019 10:02 AM

All replies

  • User381037 posted

    By the way, the projects being rebuilt are NC Wine Hopper and VA Wine Hopper for Android and iOS. Both of those are out and operational. I am trying to build NY Wine Hopper, but all three of these projects fail with the updated VS 2019. Now I have upgraded to 16.3.3 and have an unmodified project with: Marctron Admob 1.4.0 Google MobileAds 7.38.0 Newtonsoft Json 12.0.2 Plugin Permissions Refractored MVVMHelpers 1.3.0 SQLite Net PCL 1.5.231 Xamarin Essentials 1.2.0 XF

    The error is the same type but it comes up for line <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    It happened before, but I added that permission to move it to the line below it. Just updated all of the Xamarin.Android.Compat packages plus Xamarin Essentials. Clean/Build still shows the message. XF has been updated to 4.2, same issue. Marctron Admob is 1.4.3, Clean/Build same issue. MobileAds updated to 7.47.0. Clean/Build, same issue. Final update is SQLite to 1.6.292. Clean/Build, no fix. Add permission for WRITEEXTERNALSTORAGE, problem line drops to below <activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="@android:style/Theme.Translucent" />

    Changed to NetStandard 2.1, no difference. I keep referring to https://github.com/xamarin/GooglePlayServicesComponents/issues/254, but there is still no solution indicated. I was looking at the dependencies for Marctron Admob, so GooglePlayServices,Ads.Lite was attempted to be added to the project, not compatible even after backing up to NetStandard 2.0. Changed target Android version to 9 and rebuilt, same problem. Still can't add the ads service, any ideas?

    Wednesday, October 9, 2019 10:29 AM
  • User246900 posted

    Hi, @slink99 I'm the creator of Marctron.Admob. do you still have issues with the library? Not sure if your issue is related to my plugin but in case, I suggest you to update it to te latest version 1.4.4. Install Xamarin.Google.iOS.SignIn 4.4.0 otherwise you can have some compilation errors on iOS.

    If you have issues, you can find a tutorial here: https://www.xamarinexpert.it/admob-made-easy/ or you write me

    Monday, October 28, 2019 9:16 AM
  • User381037 posted

    Yes, Marco, I still have issues in the Android version. My usual routine is to get Android going and published first since it should be less demanding. I have now verified the functionality of iOS after adding a couple of dependencies. After that, I was hoping that adding dependencies for Android would be the solution. If so, I haven't found the correct combination. Everything is on the latest version.

    Monday, October 28, 2019 9:32 AM
  • User381037 posted

    I found a similar issue which mentioned removing extra NuGet packages that were not needed. I took out the packages listed and things still compile with that one line out of place. The line is the exact same as one inside of Activity other than the fact that it is missing android:export="false" According to the other post, the errant line was removed after getting the dependencies set properly, so I went through and added dependencies that seemed to be missing. Still no fix, since I have removed the line and tweaked the remaining lines to remove the android:export tag. Nothing seems to work, any additional ideas appreciated.

    Monday, October 28, 2019 10:14 PM
  • User381037 posted

    This is still not solved, but there was one issue that may help others. VS had decided to include the dll file as a reference, which created hundreds of conflict warnings. Clearing that out eliminated those. Still working on the dependencies list and adding files indicated. It is odd that compilation and execution worked fine for iOS without these.

    Sunday, November 3, 2019 1:22 PM
  • User381037 posted

    It is looking like this may be fixed by following the Aapt2 instructions about halfway down the page https://docs.microsoft.com/en-us/xamarin/android/release-notes/10/10.0#aapt2-enabled-by-default-for-all-projects

    Saturday, November 9, 2019 12:56 AM