as3-universal-analytics icon indicating copy to clipboard operation
as3-universal-analytics copied to clipboard

IOS Black Screen: Launch Failed

Open TobyKaos opened this issue 7 years ago • 22 comments

I have added uanalytics 0.8.0 for Air.

On launch of my app I create the Configuration and the tracker. All is ok on Android (Air27) and flash(Air28) versions. But on IOS(Air27) the app does not start.

Note: I used Starling V1.8. FlashDevelop 5.3.

TobyKaos avatar Feb 16 '18 10:02 TobyKaos

Like that it's hard to see what's happening, I doubt including the uanalytics lib would prevent an app to start

on iOS did you try to remove all reference of the lib uanalytics? and if so, then does the app start?

on iOS you are supposed to only connect to HTTPS URL so when you are including the lib uanalytics do you configure it to use SSL?

eg.

var config:Configuration = new Configuration();
    config.forceSSL = true;

zwetan avatar Feb 16 '18 11:02 zwetan

Then I only remove start code and it works. And no I have not use forceSSL. I will try this and I think you are right about this. I will tell you asap, thank you.

TobyKaos avatar Feb 16 '18 11:02 TobyKaos

if you absolutely need to not use HTTPS you should be able to edit your AIR app xml iOS Settings

and add the key

<key>NSAppTransportSecurity</key>  
<dict>  
  <key>NSAllowsArbitraryLoads</key>  
  <true/>  
<dict>

that said, I would advise to always use HTTPS

zwetan avatar Feb 16 '18 11:02 zwetan

arf, no. It is not better. I have no crash logs and do not know how to active it (Starling framework)

TobyKaos avatar Feb 16 '18 11:02 TobyKaos

ok then, could you show me how you initialise all that in code?

zwetan avatar Feb 16 '18 11:02 zwetan

in an initialize function, called by the constructor of the Document Class of the app:

config = new Configuration();
config.anonymizeIp = true;
config.forceSSL = true;

mTracker = new AppTracker(viewID, config);

var appinfo:ApplicationInfo = generateAIRAppInfo();

mTracker.add( appinfo.toDictionary() );

this works well on Android

TobyKaos avatar Feb 16 '18 11:02 TobyKaos

ok so basic check

in your main class, does those properties config and mTracker are declared as static variables ?

zwetan avatar Feb 16 '18 11:02 zwetan

private var mTracker:AppTracker = null;
private var config:Configuration = null;

TobyKaos avatar Feb 16 '18 11:02 TobyKaos

Then I obtains this error in remote debug: [Fault] exception, information=TypeError: Error #1080: Illegal value for namespace

TobyKaos avatar Feb 16 '18 11:02 TobyKaos

ok so try to do something like that instead

eg.

package com.foobar.blah
{
    public class Main
    {
        public static var tracker: AppTracker;

        public function Main()
        {
            // ...
        }

        public function onStartStuff()
        {
            // ...
            tracker = new AppTracker(viewID, config);
            // ...
        }

    }
}

and so later in other part of the app you can still reference the tracker eg. Main.tracker.doSomethign()

zwetan avatar Feb 16 '18 11:02 zwetan

humm #1080: Illegal value for namespace maybe there is a bug with generateAIRAppInfo()

try to not use it and initialise by hand eg.

var gameinfo:Dictionnary = new Dictionnary();
    gameinfo[ Tracker.APP_NAME ] = "My Game";
    gameinfo[ Tracker.APP_ID ] = "com.something.mygame";
    gameinfo[ Tracker.APP_VERSION ] = "1.0.0";
    gameinfo[ Tracker.APP_INSTALLER_ID ] = "Amazon App Store";

tracker.add( gameinfo );

zwetan avatar Feb 16 '18 11:02 zwetan

Yes stack is in generateAIRAppInfo(). I will try without

TobyKaos avatar Feb 16 '18 11:02 TobyKaos

I would be interested in the error stack trace if possible (you can send it privately by email if you prefer), so I can fix that bug for later

in your AIR app descriptor do you use multiple languages?

eg.

<name> 
    <text xml:lang="en">Sample 1.0</text> 
    <text xml:lang="fr">Échantillon 1.0</text> 
    <text xml:lang="de">Stichprobe 1.0</text> 
</name>

zwetan avatar Feb 16 '18 11:02 zwetan

This work without generateAIRIngo: error is here: global/libraries.uanalytics.utils::generateAIRAppInfo at /Volumes/prototype/libraries/as3-universal-analytics/src/libraries/uanalytics/utils/generateAIRAppInfo.as:105

TobyKaos avatar Feb 16 '18 11:02 TobyKaos

yeah there is a bug

generateAIRAppInfo.as:105 is

app_name = descriptor.name.text.(@xml::lang == lang);

and before

// first we use the default system language
var lang:String = Capabilities.language;

but after thinking of it the default language on the phone is not necessarily the default language we want to define in the app, etc.

zwetan avatar Feb 16 '18 11:02 zwetan

maybe on iPad air 2 ios 11 the namespace is not http://www.w3.org/XML/1998/namespace

I am not an expert on actionscript and XML

TobyKaos avatar Feb 16 '18 12:02 TobyKaos

I'm pretty sure it is an issue between the Capabilities.language and the AIR descriptor

either simple

<name>Sample Something</name> 

or complex

<name> 
    <text xml:lang="en">Sample 1.0</text> 
    <text xml:lang="fr">Échantillon 1.0</text> 
    <text xml:lang="de">Stichprobe 1.0</text> 
</name>

if you could tell me wether your app descriptor is simple or complex, it could help

zwetan avatar Feb 16 '18 12:02 zwetan

Yes it is complex.

<name>
    <text aaa:lang="fr" xmlns:aaa="http://www.w3.org/XML/1998/namespace">Glucozor test</text>
    <text aaa:lang="en" xmlns:aaa="http://www.w3.org/XML/1998/namespace">Glucozor test</text>
    <text aaa:lang="de" xmlns:aaa="http://www.w3.org/XML/1998/namespace">Glucozor test</text>
    <text aaa:lang="es" xmlns:aaa="http://www.w3.org/XML/1998/namespace">Glucozor test</text>
    <text aaa:lang="it" xmlns:aaa="http://www.w3.org/XML/1998/namespace">Glucozor test</text>
    <text aaa:lang="zh" xmlns:aaa="http://www.w3.org/XML/1998/namespace">Glucozor test</text>
  </name>

TobyKaos avatar Feb 16 '18 12:02 TobyKaos

is that the output from debug stacktrace or is it how you defined the AIR descriptor XML?

zwetan avatar Feb 16 '18 12:02 zwetan

` var na:NativeApplication = NativeApplication.nativeApplication; var desc:XML = na.applicationDescriptor;

trace(desc.toXMLString()); `

I defined multi app name in my application.xml file

TobyKaos avatar Feb 16 '18 12:02 TobyKaos

ok thanks for the information and the bug report

zwetan avatar Feb 16 '18 13:02 zwetan

Hi, since starling flox will shut down this year, I will need something to analyse my app. Is this bug still happening. My XML also uses different names as per language.

llorenzo avatar Jan 10 '20 16:01 llorenzo