Bonjour,

Voila je rencontre un petit problème avec mon code.

Ce que je fais

j'ai une application développé avec ionic. Sous android aucun problème pour la compiler et la lancer. Par contre lorsque j'essaie de compiler avec mon mac pour le lancer via l'émulateur ios rien ne se passe.

Ci-dessous mon app.js

    'Use Strict';
angular.module('App', ['ionic', 'ionic.service.core', 'ngCordova', 'ngCordovaOauth', 'ngStorage', 'ngMessages', 'firebase', 'ionic-datepicker', 'ionic-timepicker', 'monospaced.elastic', 'angularMoment', 'jrCrop']) //, 'ionic.service.push', 'ionic.service.core'
.config(function($stateProvider, $urlRouterProvider) {
    $stateProvider
    .state('menu', {
        url: "/menu",
        abstract: true,
        templateUrl: "views/menu/menu.html",
        controller: 'menuController'
    })
    .state('login', {
      url: '/login',
      templateUrl: 'views/login/login.html',
      controller:'loginController'
    })
    .state('forgot', {
      url: '/forgot',
      templateUrl: 'views/forgot/forgot.html',
      controller:'forgotController'
    })
    .state('register', {
      url: '/register',
      templateUrl: 'views/register/register.html',
      controller:'registerController'
    })
    .state('menu.home', {
        url: '/home',

        views: {
            'menuContent': {
                templateUrl: 'views/home/home.html',
                controller: 'homeController'
            }
        }
    })
    .state('menu.contacts', {
        url: '/contacts',

        views: {
            'menuContent': {
                templateUrl: 'views/contacts/contacts.html',
                controller: 'contactsController'
            }
        }
    })
    .state('contacts', {
        url: '/contacts',          
    templateUrl: 'views/contacts/contacts.html',
    controller: 'contactsController'
    })
    .state('menu.profiles', {
        url: '/profiles',

        views: {
            'menuContent': {
                templateUrl: 'views/profiles/profiles.html',
                controller: 'profilesController'
            }
        }
    })
    .state('profiles', {
        url: '/profiles',
        templateUrl: 'views/profiles/profiles.html',
        controller: 'profilesController'
    })
    .state('menu.editprofile', {
        url: '/editprofile/:editprofile',

        views: {
            'menuContent': {
                templateUrl: 'views/editprofile/editprofile.html',
                controller: 'editprofileController'
            }
        }
    })
     .state('editprofile', {
         url: '/editprofile/:editprofile',
        templateUrl: 'views/editprofile/editprofile.html',
         controller: 'editprofileController'
     })

 .state('menu.myevents', {
     url: '/myevents',
     views: {
         'menuContent': {
             templateUrl: 'views/myevents/myevents.html',
             controller: 'myeventsController'
         }
     }
 })
    .state('menu.event', {
        url: '/event/:idevent',
        params: { idevent: null },
        views: {
            'menuContent': {
                templateUrl: 'views/event/event.html',
                controller: 'eventController'
            }
        }
    })
    .state('event', {
        url: '/event/:idevent',
        params: { idevent: null },
        templateUrl: 'views/event/event.html',
        controller: 'eventController'
    })
    .state('menu.editevent', {
        url: '/editevent/:idevent',
        params: { idevent: null },

        views: {
            'menuContent': {
                templateUrl: 'views/editevent/editevent.html',
                controller: 'editeventController'
            }
        }
    })
    .state('editevent', {
        url: '/editevent/:idevent',
        params: { idevent: null },
        templateUrl: 'views/editevent/editevent.html',
        controller: 'editeventController'
    })
    .state('menu.setlocation', {
        url: '/setlocation',

        views: {
            'menuContent': {
                templateUrl: 'views/setlocation/setlocation.html',
                controller: 'setlocationController'
            }
        }
    })
    .state('menu.messages', {
        url: '/messages/:iduser',

        views: {
            'menuContent': {
                templateUrl: 'views/messages/messages.html',
                controller: 'messagesController'
            }
        }
    })
    .state('messages', {
        url: '/messages/:iduser',
        templateUrl: 'views/messages/messages.html',
        controller: 'messagesController'
    })
    .state('posts', {
        url: '/posts/:idevent',
        templateUrl: 'views/posts/posts.html',
        controller: 'postsController'
    })
    .state('server', {
        url: '/server',
        templateUrl: 'views/server/server.html',
        controller: 'serverController'
    })
    ;
$urlRouterProvider.otherwise("/login");
})

// Changue this for your Firebase App URL.
.constant('FURL', 'https://xxxxxxxxxxxx.firebaseIO.com/')

.run(function ($ionicPlatform, $cordovaSQLite, $cordovaGeolocation, geoLocation, $rootScope,$localStorage,  $ionicPopup) {
    $ionicPlatform.ready(function () {

        if (window.cordova) {
            var push = new Ionic.Push({
                "debug": true,
                "onNotification": function (notification) {

                    var payload = notification.payload;
                },
                "onRegister": function (data) {
                    console.log(data.token);
                },
                "pluginConfig": {
                    "ios": {
                        "badge": true,
                        "sound": true
                    },
                    "android": {
                        "icon": "ic_logo",
                        "iconColor": "#ee9425",

                        //"Collapse Key": "message",
                        "sound": true
                    }
                }
            });

            push.register(function (token) {
                console.log("Device token:", token.token);
                $localStorage.token = token.token;
                push.saveToken(token);  // persist the token in the Ionic Platform
            });
        }
        navigator.geolocation.getCurrentPosition(function (location) {
            console.log('[GEOLOCAL JS1] Location');
        },
    function (error) {
        console.log('[GEOLOCAL JS1] error with GPS: error.code: ' + error.code + ' Message: ' + error.message);
    });

geoLocation.setGeolocation(0.0, 0.0);

        $cordovaGeolocation
            .getCurrentPosition()
            .then(function (position) {
                geoLocation.setGeolocation(position.coords.latitude, position.coords.longitude);
            }, function (err) {
                // you need to enhance that point
                $ionicPopup.alert({
                    title: 'Ooops...',
                    template: err.message
                });

                // geoLocation.setGeolocation(defaultLocalisation.latitude, defaultLocalisation.longitude)
            });

        // begin a watch
        var watch = $cordovaGeolocation.watchPosition({
            frequency: 1000,
            maximumAge: 0,
            timeout: 30000,
            enableHighAccuracy: false
        }).then(function () {
        }, function (err) {
            console.log(err);
            // you need to enhance that point
         //   geoLocation.setGeolocation(defaultLocalisation.latitude, defaultLocalisation.longitude);
        }, function (position) {
            geoLocation.setGeolocation(position.coords.latitude, position.coords.longitude);
            // broadcast this event on the rootScope
            $rootScope.$broadcast('location:change', geoLocation.getGeolocation());
        }
        );
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if(window.cordova && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
    }
    if(window.StatusBar) {
      StatusBar.styleDefault();
    }

    if (window.cordova) {
        db = $cordovaSQLite.openDB("my.db");
        $cordovaSQLite.execute(db, "CREATE TABLE IF NOT EXISTS user (id integer primary key, email text, password text, lastUser INTEGER DEFAULT 0)");
    } else {
        db = window.openDatabase("my.db", '1', 'my', 1024 * 1024 * 100); // browser
    }
  });

})

.run(function(amMoment) {
    amMoment.changeLocale('fr');
});

Ce que je veux

Je souhaiterais que mon application démarre corretement sous IOS.

Ce que j'obtiens

Lorsque je lance l'applicattion à l'aide de la commande "ionic emulate ios" j'obtiens cette fenêtre de chargement. Et plus rien ne se passe.

<a href="http://www.hostingpics.net/viewer.php?id=646618Sanstitre.png"><img src="http://img15.hostingpics.net/thumbs/mini_646618Sanstitre.png" alt="Heberger image" /></a>

Je ne parviens pas a identifié d'où cela provient... Je ne trouve aucun message d'erreur qui pourrait m'aider

2 réponses


Hello,

Perso pour tester mes app via le simulateur, je build l'app et je l'ouvre via XCode. Je trouve à plus simple et moins buggué !

totofe
Auteur

J'ai le même souci en l'ouvrant via XCode. Comment puis-je trouver d'où vient l'erreur?

Je ne sais pas si ça peut aider, mais lorsque j'ouvre la console log j'ai ce message:

May 11 11:46:04 Mons-iMac CoreSimulatorBridge[772]: Requesting launch of com.bringnear.bringnear with options: {
arguments = (
);
environment = {
"DYLD_FRAMEWORK_PATH" = "/Users/monmac/Library/Developer/Xcode/DerivedData/bringnear-fgrelkbokbgvjmgdadztbdejrbyw/Build/Products/Debug-iphonesimulator";
"DYLD_INSERT_LIBRARIES" = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libBacktraceRecording.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib";
"DYLD_LIBRARY_PATH" = "/Users/monmac/Library/Developer/Xcode/DerivedData/bringnear-fgrelkbokbgvjmgdadztbdejrbyw/Build/Products/Debug-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/introspection";
NSUnbufferedIO = YES;
"XCODE_BUILT_PRODUCTS_DIR_PATHS" = "/Users/monmac/Library/Developer/Xcode/DerivedData/bringnear-fgrelkbokbgvjmgdadztbdejrbyw/Build/Products/Debug-iphonesimulator";
"
XPC_DYLD_FRAMEWORK_PATH" = "/Users/monmac/Library/Developer/Xcode/DerivedData/bringnear-fgrelkbokbgvjmgdadztbdejrbyw/Build/Products/Debug-iphonesimulator";
"__XPC_DYLD_LIBRARY_PATH" = "/Users/monmac/Library/Developer/Xcode/DerivedData/bringnear-fgrelkbokbgvjmgdadztbdejrbyw/Build/Products/Debug-iphonesimulator";
};
stderr = "/dev/ttys001";
stdout = "/dev/ttys001";
"wait_for_debugger" = 1;
}
May 11 11:46:05 Mons-iMac assertiond[768]: assertion failed: 15A284 13E230: assertiond + 15801 [3C808658-78EC-3950-A264-79A64E0E463B]: 0x1
May 11 11:46:30 Mons-iMac searchd[787]: tcp_connection_destination_handle_tls_close_notify 9 closing socket due to TLS CLOSE_NOTIFY alert
May 11 11:46:31 Mons-iMac searchd[787]: tcp_connection_destination_handle_tls_close_notify 12 closing socket due to TLS CLOSE_NOTIFY alert
May 11 11:46:32 Mons-iMac backboardd[765]: SecTaskLoadEntitlements failed error=22 cs_flags=200, task->pid_self=-1
May 11 11:46:32 Mons-iMac backboardd[765]: SecTaskCopyDebugDescription: bringnear[835]
May 11 11:46:32 Mons-iMac backboardd[765]: SecTaskLoadEntitlements failed error=22 cs_flags=200, task->pid_self=-1
May 11 11:46:32 Mons-iMac backboardd[765]: SecTaskCopyDebugDescription: bringnear[835]
May 11 11:46:32 Mons-iMac backboardd[765]: SecTaskLoadEntitlements failed error=22 cs_flags=200, task->pid_self=-1
May 11 11:46:32 Mons-iMac backboardd[765]: SecTaskCopyDebugDescription: bringnear[835]
May 11 11:46:32 Mons-iMac backboardd[765]: SecTaskLoadEntitlements failed error=22 cs_flags=200, task->pid_self=-1
May 11 11:46:32 Mons-iMac backboardd[765]: SecTaskCopyDebugDescription: bringnear[835]
May 11 11:46:32 Mons-iMac backboardd[765]: SecTaskLoadEntitlements failed error=22 cs_flags=200, task->pid_self=-1
May 11 11:46:32 Mons-iMac backboardd[765]: SecTaskCopyDebugDescription: bringnear[835]
May 11 11:46:32 Mons-iMac bringnear[835]: assertion failed: 15A284 13E230: libxpc.dylib + 57882 [66C28065-C9DB-3C8E-926F-5A40210A6D1B]: 0x7d
May 11 11:46:32 Mons-iMac bringnear[835]: DiskCookieStorage changing policy from 2 to 0, cookie file: file:///Users/monmac/Library/Developer/CoreSimulator/Devices/264C7F48-AC6D-42B1-A40D-861F6295AA36/data/Containers/Data/Application/11A7BDB2-2EA1-469C-BD68-6761674ADF89/Library/Cookies/com.bringnear.bringnear.binarycookies
May 11 11:46:32 Mons-iMac assertiond[768]: assertion failed: 15A284 13E230: assertiond + 15801 [3C808658-78EC-3950-A264-79A64E0E463B]: 0x1
May 11 11:46:32 --- last message repeated 1 time ---
May 11 11:46:32 Mons-iMac SpringBoard[764]: [MPUSystemMediaControls] Updating supported commands for now playing application.
May 11 11:46:33 Mons-iMac bringnear[835]: Apache Cordova native platform version 4.1.1 is starting.
May 11 11:46:33 Mons-iMac bringnear[835]: Multi-tasking -> Device: YES, App: YES
May 11 11:46:33 Mons-iMac searchd[787]: tcp_connection_tls_session_error_callback_imp 10 __tcp_connection_tls_session_callback_write_block_invoke.434 error 22
May 11 11:46:33 Mons-iMac bringnear[835]: Using UIWebView
May 11 11:46:33 Mons-iMac bringnear[835]: [CDVTimer][handleopenurl] 0.066996ms
May 11 11:46:33 Mons-iMac bringnear[835]: [CDVTimer][intentandnavigationfilter] 1.022995ms
May 11 11:46:33 Mons-iMac bringnear[835]: [CDVTimer][gesturehandler] 0.052989ms
May 11 11:46:34 Mons-iMac bringnear[835]: [CDVTimer][file] 72.597027ms
May 11 11:46:34 Mons-iMac bringnear[835]: [CDVTimer][splashscreen] 135.087013ms
May 11 11:46:34 Mons-iMac bringnear[835]: [CDVTimer][statusbar] 11.636019ms
May 11 11:46:34 Mons-iMac bringnear[835]: [CDVTimer][socialsharing] 129.334986ms
May 11 11:46:34 Mons-iMac bringnear[835]: VERSION LABEL: 0.0.2:1462959142:
May 11 11:46:34 Mons-iMac bringnear[835]: updating version label
May 11 11:46:34 Mons-iMac bringnear[835]: [CDVTimer][ionicdeploy] 22.529006ms
May 11 11:46:34 Mons-iMac bringnear[835]: [CDVTimer][keyboard] 0.180960ms
May 11 11:46:34 Mons-iMac bringnear[835]: [CDVTimer][TotalPluginStartup] 374.890029ms
May 11 11:46:34 Mons-iMac bringnear[835]: createNotificationChecker
May 11 11:46:34 Mons-iMac bringnear[835]: not coldstart
May 11 11:46:34 Mons-iMac bringnear[835]: active
May 11 11:46:34 Mons-iMac bringnear[835]: PushPlugin skip clear badge
May 11 11:46:34 Mons-iMac assertiond[768]: assertion failed: 15A284 13E230: assertiond + 15801 [3C808658-78EC-3950-A264-79A64E0E463B]: 0x1
May 11 11:46:36 --- last message repeated 5 times ---
May 11 11:46:36 Mons-iMac bringnear[835]: uuid is:
May 11 11:46:36 Mons-iMac bringnear[835]: ignore deploy
May 11 11:46:36 Mons-iMac bringnear[835]: ignore version:
May 11 11:46:37 Mons-iMac MailCompositionService[838]: assertion failed: 15A284 13E230: libxpc.dylib + 57882 [66C28065-C9DB-3C8E-926F-5A40210A6D1B]: 0x7d
May 11 11:46:37 Mons-iMac assertiond[768]: assertion failed: 15A284 13E230: assertiond + 15801 [3C808658-78EC-3950-A264-79A64E0E463B]: 0x1
May 11 11:46:37 Mons-iMac MailCompositionService[838]: Failed to inherit CoreMedia permissions from 835: (null)
May 11 11:46:37 Mons-iMac bringnear[835]: (Error) MC: MobileContainerManager gave us a path we weren't expecting; file a radar against them
Expected: /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
Actual: /Users/monmac/Library/Developer/CoreSimulator/Devices/264C7F48-AC6D-42B1-A40D-861F6295AA36/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
Overriding MCM with the one true path
May 11 11:46:38 Mons-iMac assertiond[768]: assertion failed: 15A284 13E230: assertiond + 15801 [3C808658-78EC-3950-A264-79A64E0E463B]: 0x1
May 11 11:47:08 --- last message repeated 1 time ---
May 11 11:47:08 Mons-iMac assertiond[768]: assertion failed: 15A284 13E230: assertiond + 15801 [3C808658-78EC-3950-A264-79A64E0E463B]: 0x1
May 11 11:47:08 Mons-iMac assertiond[768]: assertion failed: 15A284 13E230: assertiond + 15801 [3C808658-78EC-3950-A264-79A64E0E463B]: 0x1
May 11 11:50:01 Mons-iMac routined[753]: Connection interrupted!
May 11 11:50:01 Mons-iMac suggestd[788]: Connection interrupted!
May 11 11:50:01 --- last message repeated 1 time ---
May 11 11:50:01 Mons-iMac MobileCal[826]: Connection interrupted!
May 11 11:50:11 Mons-iMac SpringBoard[764]: Communications error: <OS_xpc_error: <error: 0x10fc91b40> { count = 1, contents =
"XPCErrorDescription" => <string: 0x10fc91ef0> { length = 22, contents = "Connection interrupted" }
}>
May 11 11:50:11 Mons-iMac fileproviderd[752]: Communications error: <OS_xpc_error: <error: 0x106a83b40> { count = 1, contents =
"XPCErrorDescription" => <string: 0x106a83ef0> { length = 22, contents = "Connection interrupted" }
}>
May 11 11:50:11 Mons-iMac searchd[787]: Communications error: <OS_xpc_error: <error: 0x10d723b40> { count = 1, contents =
"XPCErrorDescription" => <string: 0x10d723ef0> { length = 22, contents = "Connection interrupted" }
}>
May 11 11:50:11 Mons-iMac CoreSimulatorBridge[772]: Communications error: <OS_xpc_error: <error: 0x10ea94b40> { count = 1, contents =
"XPCErrorDescription" => <string: 0x10ea94ef0> { length = 22, contents = "Connection interrupted" }
}>
May 11 11:50:11 Mons-iMac SpringBoard[764]: Communications error: <OS_xpc_error: <error: 0x10fc91b40> { count = 1, contents =
"XPCErrorDescription" => <string: 0x10fc91ef0> { length = 22, contents = "Connection interrupted" }
}>
May 11 11:50:29 Mons-iMac routined[753]: CoreLocation: Error occurred while trying to retrieve motion state update: CMErrorDomain Code:104