Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

NullPointerException while building app #11

Open
lazarec opened this issue Jan 11, 2018 · 3 comments
Open

NullPointerException while building app #11

lazarec opened this issue Jan 11, 2018 · 3 comments

Comments

@lazarec
Copy link

lazarec commented Jan 11, 2018

Hello,
Firstly, I would like to thank you for your job. It looks on good tool for develeping garmin based apps.
However I got error during buid appliction. I installed plugin from repository and then created key. I got errors ( I changed paths in logs, I don't want to share my disk structure):

Logs:
Information:"C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.3.2\jre64\bin\java" -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar C:/Tools/connectiq-sdk-win-2.4.1\bin\monkeybrains.jar -o C:\IdeaProjects\untitled3\out\production\untitled3\untitled3.prg -w -y C:\Tools\connectiq-sdk-win-2.4.1\klucz.txt -z C:\IdeaProjects\untitled3\resources\drawables\drawables.xml;C:\IdeaProjects\untitled3\resources\layouts\layout.xml;C:\IdeaProjects\untitled3\resources\strings\strings.xml -m C:/IdeaProjects/untitled3\manifest.xml C:\IdeaProjejcts\untitled3\source\Untitled3App.mc C:\IdeaProjects\untitled3\source\Untitled3View.mc -d square_watch_sim -s 1.2.1
Information:java.lang.NullPointerException
Information:at com.garmin.monkeybrains.devices.SimDevice.(SimDevice.java:12)
Information:at com.garmin.monkeybrains.Monkeybrains.run(Monkeybrains.java:2383)
Information:at com.garmin.monkeybrains.Monkeybrains.simpleMain(Monkeybrains.java:270)
Information:at com.garmin.monkeybrains.Monkeybrains.simpleMain(Monkeybrains.java:253)
Information:at com.garmin.monkeybrains.Monkeybrains.main(Monkeybrains.java:299)
Information:usage: monkeyc [-a ] [-b] [-c ] [-d ] [-e] [-f ] [-g] [-h
Information:] [--hideApi ] [-i ] [-k] [-m ] [-n ] [-o ]
Information:[-p ] [-r] [-s ] [-t] [-u ] [-v] [-w] [-x ] [-y
Information:] [-z ]
Information:-a,--apidb API import file
Information:-b,--buildapi Build API output files
Information:-c,--configs-dir Configuration directory for each device
Information:-d,--device Target device
Information:-e,--package-app Create an application package.
Information:-f,--jungles Jungle files
Information:-g,--debug Print debug output
Information:-h,--excludes-map-file Mapping file of exclusions
Information:--hideApi Hide API annotations
Information:-i,--import-dbg Import api.debug.xml
Information:-k,--write-db Write out the api.db file
Information:-m,--manifest Manifest file
Information:-n,--api-version The new API version
Information:-o,--output Output file to create
Information:-p,--project-info projectInfo.xml file to use when compiling
Information:-r,--release Strip debug information
Information:-s,--sdk-version SDK version to target
Information:-t,--unit-test Enables compilation of unit tests
Information:-u,--devices devices.xml file to use when compiling
Information:-v,--version Prints the compiler version
Information:-w,--warn Show compiler warnings
Information:-x,--excludes Add annotations to the exclude list
Information:-y,--private-key Private key to sign builds with
Information:-z,--rez Resource file
Information:"C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.3.2\jre64\bin\java" -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar C:/Tools/connectiq-sdk-win-2.4.1\bin\monkeybrains.jar -o C:\Users\Daro\IdeaProjects\untitled3\out\test\untitled3\untitled3.prg -w -y C:\Tools\connectiq-sdk-win-2.4.1\klucz.txt -z C:\IdeaProjects\untitled3\resources\drawables\drawables.xml;C:\IdeaProjects\untitled3\resources\layouts\layout.xml;C:\IdeaProjects\untitled3\resources\strings\strings.xml -m C:/IdeaProjects/untitled3\manifest.xml C:\IdeaProjects\untitled3\source\Untitled3App.mc C:\IdeaProjects\untitled3\source\Untitled3View.mc -d square_watch_sim -s 1.2.1 --unit-test
Information:11.01.2018 13:37 - Compilation completed with 1 error and 0 warnings in 3s 707ms
Error:null

@timcolson
Copy link

Thx @lazarec for reporting this issue! At least now I know it probably isn't just my setup.

I added the plugin to IDEA 2017.3.4, created a new project, setup the Connect SDK (v 2.4.2), selected my Developer Key, build and see the same issue you shared (Error:null), but with paths from my Mac OS 10.13.3, and Java SDK 1.8.0_162.

Sadness. I was hoping to avoid the frustrations of the Eclipse IDE. 😞

Information:"/Applications/IntelliJ IDEA.app/Contents/jdk/Contents/Home/jre/bin/java" -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar /Users/timcolson/code/connectiq-sdk/bin/monkeybrains.jar -o /Users/timcolson/code/supertimer/out/production/supertimer/supertimer.prg -w -y /Users/timcolson/code/connectiq-sdk/developer_key -z /Users/timcolson/code/supertimer/resources/strings/strings.xml:/Users/timcolson/code/supertimer/resources/drawables/drawables.xml:/Users/timcolson/code/supertimer/resources/layouts/layout.xml:/Users/timcolson/code/supertimer/resources/menus/menu.xml -m /Users/timcolson/code/supertimer/manifest.xml /Users/timcolson/code/supertimer/source/SupertimerDelegate.mc /Users/timcolson/code/supertimer/source/SupertimerView.mc /Users/timcolson/code/supertimer/source/SupertimerApp.mc /Users/timcolson/code/supertimer/source/SupertimerMenuDelegate.mc -d square_watch_sim -s 1.2.1
Information:java.lang.NullPointerException
Information:at com.garmin.monkeybrains.devices.SimDevice.<init>(SimDevice.java:12)
Information:at com.garmin.monkeybrains.Monkeybrains.run(Monkeybrains.java:2385)
Information:at com.garmin.monkeybrains.Monkeybrains.simpleMain(Monkeybrains.java:270)
Information:at com.garmin.monkeybrains.Monkeybrains.simpleMain(Monkeybrains.java:253)
Information:at com.garmin.monkeybrains.Monkeybrains.main(Monkeybrains.java:299)
Information:usage: monkeyc [-a <arg>] [-b] [-c <arg>] [-d <arg>] [-e] [-f <arg>] [-g] [-h
Information:<arg>] [--hideApi <arg>] [-i <arg>] [-k] [-m <arg>] [-n <arg>] [-o <arg>]
Information:[-p <arg>] [-r] [-s <arg>] [-t] [-u <arg>] [-v] [-w] [-x <arg>] [-y
Information:<arg>] [-z <arg>]
Information:-a,--apidb <arg>            API import file
Information:-b,--buildapi               Build API output files
Information:-c,--configs-dir <arg>      Configuration directory for each device
Information:-d,--device <arg>           Target device
Information:-e,--package-app            Create an application package.
Information:-f,--jungles <arg>          Jungle files
Information:-g,--debug                  Print debug output
Information:-h,--excludes-map-file <arg>Mapping file of exclusions
Information:--hideApi <arg>          Hide API annotations
Information:-i,--import-dbg <arg>       Import api.debug.xml
Information:-k,--write-db               Write out the api.db file
Information:-m,--manifest <arg>         Manifest file
Information:-n,--api-version <arg>      The new API version
Information:-o,--output <arg>           Output file to create
Information:-p,--project-info <arg>     projectInfo.xml file to use when compiling
Information:-r,--release                Strip debug information
Information:-s,--sdk-version <arg>      SDK version to target
Information:-t,--unit-test              Enables compilation of unit tests
Information:-u,--devices <arg>          devices.xml file to use when compiling
Information:-v,--version                Prints the compiler version
Information:-w,--warn                   Show compiler warnings
Information:-x,--excludes <arg>         Add annotations to the exclude list
Information:-y,--private-key <arg>      Private key to sign builds with
Information:-z,--rez <arg>              Resource file
Information:"/Applications/IntelliJ IDEA.app/Contents/jdk/Contents/Home/jre/bin/java" -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar /Users/timcolson/code/connectiq-sdk/bin/monkeybrains.jar -o /Users/timcolson/code/supertimer/out/test/supertimer/supertimer.prg -w -y /Users/timcolson/code/connectiq-sdk/developer_key -z /Users/timcolson/code/supertimer/resources/strings/strings.xml:/Users/timcolson/code/supertimer/resources/drawables/drawables.xml:/Users/timcolson/code/supertimer/resources/layouts/layout.xml:/Users/timcolson/code/supertimer/resources/menus/menu.xml -m /Users/timcolson/code/supertimer/manifest.xml /Users/timcolson/code/supertimer/source/SupertimerDelegate.mc /Users/timcolson/code/supertimer/source/SupertimerView.mc /Users/timcolson/code/supertimer/source/SupertimerApp.mc /Users/timcolson/code/supertimer/source/SupertimerMenuDelegate.mc -d square_watch_sim -s 1.2.1 --unit-test
Information:2/9/18, 8:20 PM - Compilation completed with 1 error and 0 warnings in 3s 615ms
Error:null

@timcolson
Copy link

Yay! Woot! I got it to work ~5 min after posting that error log.

I updated the three areas:

  • Project Structure -> Project Settings -> Modules -> Target Device : set as "Forerunner 235" & Target SDK 1.3.x.
  • Run configuration - set device to Forerunner 235.
  • Update manifest.xml q:product id="square_watch" to "f235"

At that point, compilation gave me a clue:

Error:fr235: Invalid device ID found in the manifest: f235
Error:Invalid device ID found.

Setting it back to "square_watch", fails, but setting to "fr235" - the proper ID, and it works!

I hope this helps others troubleshoot!
-Tim

@liias
Copy link
Owner

liias commented Feb 10, 2018

Glad you found a workaround.

I am sorry for being inactive with this project, but currently I am not really planning to continue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants