Search code examples
javascriptgoogle-analyticswindows-store-apps

GoogleAnalyticsSDK 1.3 in 64-bit JavaScript Windows 10 App - Module Could Not Be Found


How do you get Google Analytics SDK 1.3 to work in a JavaScript Windows 10 (UWP) app in x64 mode? Referencing the libraries that are installed via the VISX installer on the project page works for x86, but not x64.

When running the application in x64 mode I get the following error:

0x8007007e - JavaScript runtime error: The specified module could not be found. 

Solution

    1. Get rid of any references to the GoogleAnalytics libraries that you have in your project.
    2. Install the GoogleAnalyticsSDK package from the standard nuget.org repository (as described in the docs for XAML apps on the CodePlex site).
    3. At this point the libraries are referenced, but in the .jsproj file NuGet incorrectly references the Windows 8 WinMD files and specifies a few other settings that cause problems.
    4. Open your .jsproj in a text editor.
    5. Change the GoogleAnalytics and GoogleAnalytics.Core references to look like the following:
        <ItemGroup>
            <Reference Include="GoogleAnalytics">
                <HintPath>..\packages\GoogleAnalyticsSDK.1.3.00\lib\uap10.0\GoogleAnalytics.winmd</HintPath>
                <IsWinMDFile>true</IsWinMDFile>
            </Reference>
            <Reference Include="GoogleAnalytics.Core">
                <HintPath>..\packages\GoogleAnalyticsSDK.1.3.00\lib\uap10.0\GoogleAnalytics.Core.winmd</HintPath>
            </Reference>
        </ItemGroup>
    
    1. Reload the project in Visual Studio and you should be off to the races.