I get the "resource cannot be null" error in the latest version of the engine

When bundling my project on Defold 1.3.0, it fails with the resource cannot be null error. It bundles just fine on an older version(1.2.189) of the engine. Why does this happen?

the dependencies used are

https://github.com/defold/extension-iap/archive/2.0.2.zip
https://github.com/defold/extension-review/archive/3.0.1.zip
https://github.com/defold/extension-admob/archive/refs/tags/2.0.0.zip
https://github.com/defold/extension-push/archive/refs/tags/3.2.3.zip
https://github.com/defold/extension-gpgs/archive/refs/tags/2.4.1.zip

Can you please share a complete empty/minimal project where this happens?

I’m sorry for replying so late. Here’s it

Hope this helps

I’m not able reproduce this on macOS at least, bundling for Android. Which OS are you using and which platform did you try to bundle for?

I did have to updated extension-gpgs to version 2.5.0 though as the version you used generated a build error:

I use windows 10 and I’m trying to bundle for android. So I updated extension-gpgs to version 2.5.0 and still the same error

Could it be a file path issue? Perhaps spaces or strange characters in the path?

What if you bundle with bob from the command line? Same result? Try to bundle with --verbose to get extra logs.

Hi,

I am getting “contextResource cannot be null” when trying to make an Android Build using the GPGS extension. It was building fine even yesterday but getting this error today.

I have tried using an empty project with only the GPGS extension to figure out if there is anything wrong with my project but still getting the error.

Any and all help very welcome. Thanks.

This seems lika a duplicate of this:

I’ll merge your post with the above one!

Please share:

  • Which OS version you are using
  • Which editor version (About menu)
  • Which build server (Editor preferences)

Try this:

  • Download and bundle the GPGS project on its own from the editor:
  • Try to bundle with bob.jar instead of the editor:

I have the same issue. My project also use GPGS extension.

Thanks for the quick reply.
My OS is Windows 10 Home Single Language, Version - 21H1 (OS Build - 19043.1586)
Edition version - 1.3.0 (SHA1 cb4cc114221bf2bdabb1dd3c988fb333dc1e836a)
Build server - https://build.defold.com

I have tried bundling with bob.jar but am getting the following error -

Thanks. I’m able to reproduce the problem and will investigate immediately!

4 Likes

While we investigate: switch to build-stage.defold.com as build server to be able to proceed!

Still getting the " contextResource cannot be null" error. :frowning: :cry:

And the following error I am getting on using bob.jar

build.defold.com is up again!

Can you please show full command line when bundling with bob?

Sorry for not being clear. I am getting this error when I am building with Defold Editor and not the command line.

But now that the build.defold.com is up, I can build using the command line.

And this works?

I have managed to use the following to build an apk file.

java -jar bob.jar --archive --platform armv7-android resolve distclean build bundle

But this code

java -jar bob.jar --archive --platform arm64-android resolve distclean build bundle

is giving an error “Platform arm64-android not supported”

The “–platform=armv7-android” will give you both armv7+arm64

In order to only build arm64-android, you need to specify “–platform=armv7-android --architectures=arm64-android”

Okay, so I tried this -

C:\F\Defold\cmd_test\Mobile_game>java -jar bob.jar --archive --platform armv7-android resolve distclean build bundle

This is what I got -

    Download archive(s)Downloading 0 archive(s)
    Working...Cleaning... 1% ...done!
    Build Remote Engine...
    Building engine... ...done!
    2147483647% ...done!
    Reading tasks... ...done!
    Building... 2% 3% 4% 5% 6% 7% 8% 9% 10% 11% 12% 13% 14% 15% 16% 17% 18% 19% 20% 21% 22% 23% 24% 25% 26% 27% 28% 29% 30% 31% 32% 33% 34% 35% 36% 37% 38% 39% 40% 41% 42% 43% 44% 45% 46% 47% 48% 49% 50% 51% 52% 53% 54% 55% 56% 57% 58% 59% 60% 61% 62% 63% 64% 65% 66% 67% 68% 69% 70% 71% 72% 73% 74% 75% 76% 77% 78% 79% 80% 81% 82% 83% 84% 85% 86% 87% 88% 89% 90% 91% 92% 93% 94% 95% 96% 97% 98% 99% ...done!
    Bundling...Mar 17, 2022 7:35:25 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: Creating AAB base.zip
    Mar 17, 2022 7:35:25 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: Using extender binary for architecture: armv7-android
    Mar 17, 2022 7:35:25 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: Using extender binary for architecture: arm64-android
    Mar 17, 2022 7:35:25 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: Copying dex to C:\F\Defold\cmd_test\Mobile_game\build\armv7-android\classes.dex
    Mar 17, 2022 7:35:26 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: Copying asset C:\F\Defold\cmd_test\Mobile_game\build\default\game.projectc to C:\F\Defold\cmd_test\Mobile_game\build\default\cmd_test\aab\base\assets\game.projectc
    Mar 17, 2022 7:35:26 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: Copying asset C:\F\Defold\cmd_test\Mobile_game\build\default\game.arci to C:\F\Defold\cmd_test\Mobile_game\build\default\cmd_test\aab\base\assets\game.arci
    Mar 17, 2022 7:35:26 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: Copying asset C:\F\Defold\cmd_test\Mobile_game\build\default\game.arcd to C:\F\Defold\cmd_test\Mobile_game\build\default\cmd_test\aab\base\assets\game.arcd
    Mar 17, 2022 7:35:26 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: Copying asset C:\F\Defold\cmd_test\Mobile_game\build\default\game.dmanifest to C:\F\Defold\cmd_test\Mobile_game\build\default\cmd_test\aab\base\assets\game.dmanifest
    Mar 17, 2022 7:35:26 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: Copying asset C:\F\Defold\cmd_test\Mobile_game\build\default\game.public.der to C:\F\Defold\cmd_test\Mobile_game\build\default\cmd_test\aab\base\assets\game.public.der
    Mar 17, 2022 7:35:26 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: Copying resources to C:\F\Defold\cmd_test\Mobile_game\build\default\cmd_test\aab\base\res
    Mar 17, 2022 7:35:26 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: Copying engine to C:\F\Defold\cmd_test\Mobile_game\build\default\cmd_test\aab\base\lib\armeabi-v7a\libcmd_test.so
    Mar 17, 2022 7:35:26 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: exec: C:\Users\priya\AppData\Local\Temp\6864740468315698797\x86_64-win32\strip_android.exe C:\F\Defold\cmd_test\Mobile_game\build\default\cmd_test\aab\base\lib\armeabi-v7a\libcmd_test.so
    Mar 17, 2022 7:35:26 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: Copying engine to C:\F\Defold\cmd_test\Mobile_game\build\default\cmd_test\aab\base\lib\arm64-v8a\libcmd_test.so
    Mar 17, 2022 7:35:26 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: exec: C:\Users\priya\AppData\Local\Temp\6864740468315698797\x86_64-win32\strip_android_aarch64.exe C:\F\Defold\cmd_test\Mobile_game\build\default\cmd_test\aab\base\lib\arm64-v8a\libcmd_test.so
    Mar 17, 2022 7:35:26 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: Zipping C:\F\Defold\cmd_test\Mobile_game\build\default\cmd_test\aab\base to C:\F\Defold\cmd_test\Mobile_game\build\default\cmd_test\aab\base.zip
    Mar 17, 2022 7:35:27 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: Creating Android Application Bundle
    Mar 17, 2022 7:35:27 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: exec: C:\Program Files\Java\jdk-17.0.2\bin\java -jar C:\Users\priya\AppData\Local\Temp\6864740468315698797\bundletool-all.jar build-bundle --modules C:\F\Defold\cmd_test\Mobile_game\build\default\cmd_test\aab\base.zip --output C:\F\Defold\cmd_test\Mobile_game\build\default\cmd_test\cmd_test.aab
    Mar 17, 2022 7:35:28 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: Sign C:\F\Defold\cmd_test\Mobile_game\build\default\cmd_test\cmd_test.aab
    Mar 17, 2022 7:35:28 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: exec: C:\Program Files\Java\jdk-17.0.2\bin\jarsigner -verbose -keystore C:\F\Defold\cmd_test\Mobile_game\debug.keystore -storepass android C:\F\Defold\cmd_test\Mobile_game\build\default\cmd_test\cmd_test.aab androiddebugkey
    Mar 17, 2022 7:35:30 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: Cleanup bundle folder
    Mar 17, 2022 7:35:30 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: Creating universal APK set
    Mar 17, 2022 7:35:30 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: exec: C:\Program Files\Java\jdk-17.0.2\bin\java -jar C:\Users\priya\AppData\Local\Temp\6864740468315698797\bundletool-all.jar build-apks --mode UNIVERSAL --bundle C:\F\Defold\cmd_test\Mobile_game\build\default\cmd_test\cmd_test.aab --output C:\F\Defold\cmd_test\Mobile_game\build\default\cmd_test\cmd_test.apks --ks C:\F\Defold\cmd_test\Mobile_game\debug.keystore --ks-pass file:C:\F\Defold\cmd_test\Mobile_game\debug.keystore.pass.txt --ks-key-alias androiddebugkey
    Mar 17, 2022 7:35:32 PM com.dynamo.bob.bundle.AndroidBundler log
    INFO: Extracting universal APK from APK set
     100% ...done!
     ...done!

I don’t see the aab file in the C:\F\Defold\cmd_test\Mobile_game\build\default\cmd_test. I only have the .apk file. So I must be doing something wrong. What am I missing here?