+ Start a Discussion
Will LinWill Lin 

[Hybrid] Bootconfig.json File Not Found

I'm trying to follow the guide for creating a hybrid app and running it.

I am able to successfully create the hybrid_local project using forcedroid create. However, when I attempt to run it as an Android Application in eclipse, it crashes when trying to read the bootconfig.json, due to file not found.

The bootconfig.json is located in the root\www and also root\platforms\android\www directories. I removed the Resource Filter, so it does show up in my Project Explorer.

Environment details:
Android SDK Tools 23.0.5
Android SDK Platform Tools 21
Mobile SDK Android 2.3.0

Steps I follow:
cd [target.dir]
forcedroid create
[enter settings and create]
open Eclipse
import existing android projects
browse [target.dir]
select all 4 projects
right click project
run as android application

Log details below:

10-22 18:59:12.489: E/AndroidRuntime(866): FATAL EXCEPTION: main
10-22 18:59:12.489: E/AndroidRuntime(866): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test/com.salesforce.androidsdk.ui.sfhybrid.SalesforceDroidGapActivity}: com.salesforce.androidsdk.rest.BootConfig$BootConfigException: Failed to open www/bootconfig.json
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.os.Looper.loop(Looper.java:137)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.app.ActivityThread.main(ActivityThread.java:5041)
10-22 18:59:12.489: E/AndroidRuntime(866):     at java.lang.reflect.Method.invokeNative(Native Method)
10-22 18:59:12.489: E/AndroidRuntime(866):     at java.lang.reflect.Method.invoke(Method.java:511)
10-22 18:59:12.489: E/AndroidRuntime(866):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
10-22 18:59:12.489: E/AndroidRuntime(866):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
10-22 18:59:12.489: E/AndroidRuntime(866):     at dalvik.system.NativeStart.main(Native Method)
10-22 18:59:12.489: E/AndroidRuntime(866): Caused by: com.salesforce.androidsdk.rest.BootConfig$BootConfigException: Failed to open www/bootconfig.json
10-22 18:59:12.489: E/AndroidRuntime(866):     at com.salesforce.androidsdk.rest.BootConfig.readBootConfigFile(BootConfig.java:156)
10-22 18:59:12.489: E/AndroidRuntime(866):     at com.salesforce.androidsdk.rest.BootConfig.readFromJSON(BootConfig.java:125)
10-22 18:59:12.489: E/AndroidRuntime(866):     at com.salesforce.androidsdk.rest.BootConfig.getBootConfig(BootConfig.java:88)
10-22 18:59:12.489: E/AndroidRuntime(866):     at com.salesforce.androidsdk.ui.sfhybrid.SalesforceDroidGapActivity.onCreate(SalesforceDroidGapActivity.java:116)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.app.Activity.performCreate(Activity.java:5104)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
10-22 18:59:12.489: E/AndroidRuntime(866):     ... 11 more
10-22 18:59:12.489: E/AndroidRuntime(866): Caused by: java.io.FileNotFoundException: www/bootconfig.json
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.content.res.AssetManager.openAsset(Native Method)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.content.res.AssetManager.open(AssetManager.java:315)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.content.res.AssetManager.open(AssetManager.java:289)
10-22 18:59:12.489: E/AndroidRuntime(866):     at com.salesforce.androidsdk.rest.BootConfig.readBootConfigFile(BootConfig.java:151)
10-22 18:59:12.489: E/AndroidRuntime(866):     ... 17 more

 

bhariharanbhariharan
Please post Mobile SDK related questions on our Google+ community here (https://plus.google.com/communities/114225252149514546445).