Search code examples
androidmonaca

hybrid app not working with Monaca IDE


A few months back I started building a Hybrid application using Monaca IDE, now i'm trying to make some changes to it, the thing is that when I try to make a debug build to test the app it doesn't work, it doesn't even run, when it starts says "my app has to close", I didn't change the source code, I just added a few html and js files.

the index.html, the main js file and the config.xml are intact. I tested the build on android 2, 4.2 and 6, in none of them it works, I can post the necesary code that you need, right now i dont know what code I can post to help you guys!

I dont know if there's something new with the IDE i should be aware of!

here is my config.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <widget xmlns="http://www.w3.org/ns/widgets" id="com.example.ANTELCar" version="2.0.1">
    <name>Antel Car</name>
    <description>Antel Car</description>
    <author/>
    <content src="index.html"/>
    <preference name="loglevel" value="DEBUG"/>
      <preference name="AndroidLaunchMode" value="singleTop"/>
      <preference name="ErrorUrl" value=""/>
      <preference name="SplashScreen" value="screen"/>
      <preference name="monaca:DisableCookie" value="false"/>
      <feature name="App">
        <param name="android-package" value="org.apache.cordova.App"/>
      </feature>
       <preference name="AllowInlineMediaPlayback" value="false"/>
      <preference name="AutoHideSplashScreen" value="false"/>
      <preference name="BackupWebStorage" value="cloud"/>
      <preference name="EnableViewportScale" value="false"/>
      <preference name="FadeSplashScreen" value="true"/>
      <preference name="FadeSplashScreenDuration" value=".25"/>
      <preference name="KeyboardDisplayRequiresUserAction" value="true"/>
      <preference name="MediaPlaybackRequiresUserAction" value="false"/>
      <preference name="ShowSplashScreenSpinner" value="true"/>
      <preference name="SuppressesIncrementalRendering" value="false"/>
      <preference name="TopActivityIndicator" value="gray"/>
      <preference name="GapBetweenPages" value="0"/>
      <preference name="PageLength" value="0"/>
      <preference name="PaginationBreakingMode" value="page"/>
      <preference name="PaginationMode" value="unpaginated"/>
      <feature name="LocalStorage">
        <param name="ios-package" value="CDVLocalStorage"/>
      </feature>
      <preference name="monaca:targetFamilyiPhone" value="1"/>
      <preference name="monaca:targetFamilyiPad" value="1"/>
      <access origin="*"/>
      <access origin="mailto:*"/>
      <preference name="KeepRunning" value="false"/>
      <preference name="monaca:AndroidIsPackageNameSeparate" value="true"/>
      <preference name="DisallowOverscroll" value="true"/>
      <preference name="Orientation" value="portrait"/>
      <preference name="SplashScreenDelay" value="4000"/>
      <preference name="Fullscreen" value="false"/>
      <preference name="AndroidPersistentFileLocation" value="Compatibility"/>
      <allow-intent href="itms:*"/>
      <allow-intent href="itms-apps:*"/>
      <allow-navigation href="*"/>
    </widget>

Solution

  • The problem will not be in the IDE but within your file. When you upload a project to Monaca IDE, it does create a new blank config file. You need to make sure you set all of those settings and enable what you need for it to work. Also, if you are using custom plugins but are using the free account, those plugins will not be included.

    To confirm a working environment, I recommend using one of their default templates such as the Onsen 2.0 example to test everything and make sure your design environment is setup and working.