在ios中启动后,应用会立即关闭,但android正常吗?

时间:2018-11-02 11:15:17

标签: ios xcode ionic3

启动应用程序时,我在ios上遇到问题,它显示启动画面,然后应用程序自行关闭。在Android上运行正常。

  

现在这是我的配置:

public static void main(String[] args){
    LinkedList<String> guessed=new LinkedList<>();
    String s;
    Scanner input = new Scanner(System.in);
    while(guessed.size()<offList.length){
        System.out.println("Guessed= "+guessed.toString()); //you have to change it, if you want a better look
        System.out.print("Try:");
        s=input.nextLine();
        /*Here we ask to the user the same thing, unless the guessed list 
        contains all the words of offList.
        Every time we print the guessed worlds list*/ 
        if(find(s)){
            System.out.println("This world is in offList!");
            if(!guessed.contains(s)) //the world is counted only one time!
                guessed.add(s);
        }else
            System.out.println("Sorry...");
    }
    System.out.println("The complete list is "+guessed.toString());

}
  

我的插件列表如下:

<preference name="ScrollEnabled" value="false" />
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="1000" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="SplashScreenDelay" value="5000" />
<preference name="FadeSplashScreen" value="true" />
<preference name="orientation" value="portrait" />
<preference name="loadUrlTimeoutValue" value="60000" />
  

我的离子信息如下:

cli软件包:(/ usr / local / lib / node_modules)

cordova-plugin-camera 4.0.3 "Camera"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-facebook4 1.7.4 "Facebook Connect"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-firebase 2.0.5 "Google Firebase Plugin"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-googleplus 5.3.2 "Google SignIn"
cordova-plugin-ionic-webview 1.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-plugin-x-socialsharing 5.4.1 "SocialSharing"
es6-promise-plugin 4.2.2 "Promise"
ionic-plugin-keyboard 2.2.1 "Keyboard"
onesignal-cordova-plugin 2.4.3 "OneSignal Push Notifications"

全局软件包:

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

本地软件包:

cordova (Cordova CLI) : 7.1.0 

系统:

@ionic/app-scripts : 3.1.6
Cordova Platforms  : ios 4.1.0
Ionic Framework    : ionic-angular 3.9.2

环境变量:

ios-deploy : 1.9.2 
Node       : v6.12.0
npm        : 3.10.10 
OS         : macOS High Sierra
Xcode      : Xcode 9.2 Build version 9C40b 

其他:

ANDROID_HOME : not set

我也尝试过使用Cordova Platform 4.4.0和4.5.1,但是遇到了同样的问题。

1 个答案:

答案 0 :(得分:0)

无法看到您的Config.xml,我只能推测您由于缺少权限字符串而试图使用Xcode中被拒绝的权限。

您是否正在使用相机,麦克风,图片库或位置服务?

通常,当应用崩溃时,XCode将在日志上输出错误消息。在大多数情况下,这是由于缺少plist.info字符串造成的。

这是我的config.xml的示例,其中包括用法说明:

    <edit-config file="*-Info.plist" mode="overwrite" target="NSCameraUsageDescription">
        <string>To take photos.</string>
    </edit-config>
    <edit-config file="*-Info.plist" mode="overwrite" target="NSPhotoLibraryUsageDescription">
        <string>To choose photos.</string>
    </edit-config>
    <edit-config file="*-Info.plist" mode="overwrite" target="NSMicrophoneUsageDescription">
        <string>To record videos.</string>
    </edit-config>
    <edit-config file="*-Info.plist" mode="overwrite" target="Use for video and audio messages">
        <string>To record videos.</string>
    </edit-config>
    <edit-config file="*-Info.plist" mode="overwrite" target="NSLocationAlwaysUsageDescription">
        <string>We use your location for...</string>
    </edit-config>
    <edit-config file="*-Info.plist" mode="overwrite" target="NSLocationAlwaysAndWhenInUseUsageDescription">
        <string>We use your location for...</string>
    </edit-config>
    <edit-config file="*-Info.plist" mode="overwrite" target="NSLocationWhenInUseUsageDescription">
        <string>We use your location for...</string>
    </edit-config>

将它们添加到config.xml的底部,在标记下,然后看看会发生什么。