locked
WinRT error_80070005_Access denied

    Question

  • Hello!

    My app is listed in App Store and I downloaded a CAB-file with a JS-exception, but I can't reproduce this error because it is in

    // Initialize the license info for use in the app that is uploaded to the Store. Uncomment for release
    var currentApp = Windows.ApplicationModel.Store.CurrentApp;
    // Initialize the license info for testing. Comment the next line for release
    // var currentApp =Windows.ApplicationModel.Store.CurrentAppSimulator;
        var licenseInformation = currentApp.licenseInformation;

    Am I right when I think that I would have failed certification, if I commented the wrong line?

    I'll paste my error log and I hope, someone can help me fix this error:

    <!-- START LOG -->

    ErrorDescription=Zugriff verweigert

    Zugriff verweigert

    ErrorType=8
    ErrorTypeText=WinRT error
    ErrorNumber=80070005
    SourceFile=ms-appx://wwsoftwareughaftungsbesch.teacherssecondbrain/js/settings/einstAbout.js
    Line=10
    Character=5
    DocumentURL=/default.html
    OSProduct=Windows 8.1 Pro
    OSVersion=6.3.9600.0
    OSServicePack=0
    UserAgentString=Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; Touch; MSAppHost/2.0; rv:11.0) like Gecko
    StackTraceAvailability=2
    StackTrace=ms-appx://wwsoftwareughaftungsbesch.teacherssecondbrain/js/settings/einstAbout.js:10:5           Anonymous function()
               ms-appx://wwsoftwareughaftungsbesch.teacherssecondbrain/js/settings/einstAbout.js:3:2           Global code
    StackTraceHash=763206e53cd2c40f900fbd20d3ebdb84
    PackageFullName=WWSoftwareUGhaftungsbesch.TeachersSecondBrain_1.1.2.0_x64__pwz598ahn0drj
    AppUserModelID=WWSoftwareUGhaftungsbesch.TeachersSecondBrain_pwz598ahn0drj!App
    IsTerminal=True
    DependentPackageList=Microsoft.WinJS.2.0_1.0.9600.17018_neutral__8wekyb3d8bbwe,Microsoft.VCLibs.120.00_12.0.21005.1_x64__8wekyb3d8bbwe

    <!-- END LOG -->

    THANKS IN ADVANCE

    Dragon


       

    Saturday, April 04, 2015 9:35 AM

All replies

  • Hi Dragon-21-06-1982,

    >>SourceFile=ms-appx://wwsoftwareughaftungsbesch.teacherssecondbrain/js/settings/einstAbout.js

    From the error log, looks like there is something wrong in this file: einstAbout.js

    Could you please provide some code snippets to tell us what you have done in it?

    Generally, before we submit your app to the Store, changing every reference to CurrentAppSimulator to CurrentApp in our app's code and add each in-app product in the Submit an app workflow, See: https://msdn.microsoft.com/en-us/library/windows/apps/hh694067.aspx


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, April 06, 2015 6:50 AM
    Moderator
  • (function () {
        "use strict";
    
        var currentApp;
        var licenseInformation;
    
        function ready(element, options) {
            document.getElementById('btnEinstAboutBuy').addEventListener('click', buyApp, false);
            releaseOrDebug(); // Change for Release ! ! ! ! ! !
        }
    
        function updateLayout(element, viewState) {
            // TODO: Respond to changes in viewState.
        }
    
        function unload() {
            currentApp.licenseInformation.removeEventListener("licensechanged", reloadLicense);
        }
    
        WinJS.UI.Pages.define("/html/settings/einstAbout.html", {
            ready: ready,
            unload: unload,
            updateLayout: updateLayout
        });
    
        function releaseOrDebug() {
            var release = false; // Change 'TRUE' for Release!
            if (release == true) {
                currentApp = Windows.ApplicationModel.Store.CurrentApp;
                licenseInformation = currentApp.licenseInformation;
                currentApp.licenseInformation.addEventListener("licensechanged", reloadLicense);
                reloadLicense();
            } else if (release == false) {
                currentApp = Windows.ApplicationModel.Store.CurrentAppSimulator;
                licenseInformation = currentApp.licenseInformation;
                // Initialize the license proxy file
                loadTrialModeProxyFile();
            }
    
        }
        
        function loadTrialModeProxyFile() {
            Windows.ApplicationModel.Package.current.installedLocation.getFolderAsync("data").done(
                function (folder) {
                    folder.getFileAsync("trialSimulatorProxy.xml").done(
                        function (file) {
                            currentApp.licenseInformation.addEventListener("licensechanged", reloadLicense);
                            Windows.ApplicationModel.Store.CurrentAppSimulator.reloadSimulatorAsync(file).done();
                        });
                });
        }
    
        function reloadLicense() {
            var outputStringInfo = "";
            var outputStringTime = "";
            if (licenseInformation.isActive) {
                if (licenseInformation.isTrial) {
                    // Show the features that are available during trial only.
                    btnEinstAboutBuy.style.display = 'block';
                    einstAboutError.innerHTML = "";
                    einstAboutBuyThx.innerHTML = "";
                    einstAboutVerInfo.innerHTML = "";
                    var remainingTrialTime = (licenseInformation.expirationDate - new Date()) / 86400000;
                    outputStringInfo = WinJS.Resources.getString('EinstAboutTrial').value + WinJS.Resources.getString('EinstAboutExpiration').value;
                    einstAboutVerInfo.innerHTML = outputStringInfo;
                    if (Math.round(remainingTrialTime) == 1) {
                        outputStringTime += Math.round(remainingTrialTime) + WinJS.Resources.getString('EinstAboutExpirationDay').value;
                    } else {
                        outputStringTime += Math.round(remainingTrialTime) + WinJS.Resources.getString('EinstAboutExpirationDays').value;
                    }
                    einstAboutTimeToExpire.innerHTML = outputStringTime;
                    currentApp.loadListingInformationAsync().done(
                        function (listing) {
                            einstAboutPriceInfo.innerHTML = WinJS.Resources.getString('EinstAboutPrice1').value + listing.formattedPrice + WinJS.Resources.getString('EinstAboutPrice2').value;
                        });
                    einstAboutBuyInfo.innerHTML = WinJS.Resources.getString('EinstAboutBuyInfo').value;
                }
                else {
                    // Show the features that are available only with a full license.
                    einstAboutError.innerHTML = "";
                    einstAboutTimeToExpire.innerHTML = "";
                    einstAboutBuyInfo.innerHTML = "";
                    einstAboutPriceInfo.innerHTML = "";
                    einstAboutVerInfo.innerHTML = WinJS.Resources.getString('EinstAboutFullVersion').value;
                    einstAboutBuyThx.innerHTML = WinJS.Resources.getString('EinstAboutFullThx').value;
                    btnEinstAboutBuy.style.display = 'none';
                }
            }
            else {
                // A license is inactive only when there's an error.
                WinJS.log("Unknown error!", "error", "einstAboutError");
                btnEinstAboutBuy.style.display = 'none';
            }
        }
    
        function buyApp() {
            if (!licenseInformation.isActive || licenseInformation.isTrial) {
                currentApp.requestAppPurchaseAsync(false).done(
                function () {
                    if (licenseInformation.isActive && !licenseInformation.isTrial) {
                        // Buying successfull
                        console.log("Kauf erfolgreich.");
                    } else {
                        // Transaction failed
                        console.log("Kauf abgebrochen.");
                        WinJS.log(WinJS.Resources.getString('EinstAboutError2').value, "error", "einstAboutError");
                    }
                },
                function () {
                    // Transaction error
                    console.log("Aufruf der Kauffunktion fehlgeschlagen.");
                    WinJS.log(WinJS.Resources.getString('EinstAboutError1').value, "error", "einstAboutError");
                });
            }
        }
    
    })();
    

    Here is our complete einstAbout.js code. In releaseOrDebug() we set release=true when we make store packages.

    We call releaseOrDebug() in our ready() function.

    We have a 30 days trial of our app which has no restrictions. The 30 days are only defined in the dashboard. We want to give the user the possibility to buy our app even if the trial period isn't yet over. So we show/unshow the buy app button depending on the apps version (trial/full).

    Thanksn for your help

    Dragon

    Tuesday, April 07, 2015 7:44 AM
  • Is the reason that I don't handle the error in

    currentApp.loadListingInformationAsync().done()???

    Tuesday, April 07, 2015 8:28 AM