App crashes on Android with simple MapView

Fuse 0.20.2, Windows 10, Nexus5

My simple app crashes on Android

<App>
    <NativeViewHost>
        <MapView/>
    </NativeViewHost>
</App>

.unoproj

{
    "Packages": [
        "Fuse",
        "FuseJS",
        "Fuse.GeoLocation",
        "Fuse.Maps"
    ],
    "Includes": [
        "",
        ".js:Bundle"
    ],
    "Android": {
        "Geo": {
            "ApiKey": "my_api_key"
        }
    }
}

with errors:

06-07 18:56:12.738  7917  7917 D AndroidRuntime: Shutting down VM
06-07 18:56:12.739  7917  7917 E AndroidRuntime: FATAL EXCEPTION: main
06-07 18:56:12.739  7917  7917 E AndroidRuntime: Process: Fuse.Preview, PID: 7917
06-07 18:56:12.739  7917  7917 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke interface method 'void com.fusetools.androidmapsapi.FuseMap$FuseMapCallback.onReady()' on a null object reference
06-07 18:56:12.739  7917  7917 E AndroidRuntime:     at com.fusetools.androidmapsapi.FuseMap.configure(FuseMap.java:138)
06-07 18:56:12.739  7917  7917 E AndroidRuntime:     at com.fusetools.androidmapsapi.FuseMap.access$100(FuseMap.java:20)
06-07 18:56:12.739  7917  7917 E AndroidRuntime:     at com.fusetools.androidmapsapi.FuseMap$1.onMapReady(FuseMap.java:66)
06-07 18:56:12.739  7917  7917 E AndroidRuntime:     at com.google.android.gms.maps.MapView$zza$1.zza(Unknown Source)
06-07 18:56:12.739  7917  7917 E AndroidRuntime:     at com.google.android.gms.maps.internal.zzo$zza.onTransact(Unknown Source)
06-07 18:56:12.739  7917  7917 E AndroidRuntime:     at android.os.Binder.transact(Binder.java:387)
06-07 18:56:12.739  7917  7917 E AndroidRuntime:     at wv.a(:com.google.android.gms.DynamiteModulesB:82)
06-07 18:56:12.739  7917  7917 E AndroidRuntime:     at maps.ag.t$5.run(Unknown Source)
06-07 18:56:12.739  7917  7917 E AndroidRuntime:     at android.os.Handler.handleCallback(Handler.java:739)
06-07 18:56:12.739  7917  7917 E AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:95)
06-07 18:56:12.739  7917  7917 E AndroidRuntime:     at android.os.Looper.loop(Looper.java:148)
06-07 18:56:12.739  7917  7917 E AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417)
06-07 18:56:12.739  7917  7917 E AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)
06-07 18:56:12.739  7917  7917 E AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
06-07 18:56:12.739  7917  7917 E AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)



06-07 18:56:14.062  7917  8448 E DynamiteModule: Failed to load module descriptor class: Didn't find class "com.google.android.gms.dynamite.descriptors.com.google.android.gms.googlecertificates.ModuleDescriptor" on path: DexPathList[[zip file "/data/app/Fuse.Preview-1/base.apk"],nativeLibraryDirectories=[/data/app/Fuse.Preview-1/lib/arm, /data/app/Fuse.Preview-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
06-07 18:56:14.065  7917  8448 I DynamiteModule: Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:1
06-07 18:56:14.066  7917  8448 I DynamiteModule: Selected remote version of com.google.android.gms.googlecertificates, version >= 1
06-07 18:56:14.075  7917  8448 W System  : ClassLoader referenced unknown path: /data/user/0/com.google.android.gms/app_chimera/m/00000000/n/armeabi
06-07 18:56:14.077  7917  8448 D ChimeraFileApk: Primary ABI of requesting process is armeabi-v7a
06-07 18:56:14.087  7917  8448 D ChimeraFileApk: Classloading successful. Optimized code found.
06-07 18:56:14.093  7917  8448 D GoogleCertificates: com.google.android.gms.googlecertificates module is loaded
06-07 18:56:14.246  7917  8448 D GoogleCertificatesImpl: Fetched 154 Google release certificates
06-07 18:56:14.258  7917  8448 V GoogleSignatureVerifier: Fuse.Preview signature not valid.  Found:

Hey, this issue has been solved on our master branch and should be fixed with the next release :frowning: Sorry about this

Tried the latest build 0.21.0 and I still cannot preview on Android. however when building in release the app works ok

06-21 21:25:34.069 11387 11387 E AndroidRuntime: FATAL EXCEPTION: main
06-21 21:25:34.069 11387 11387 E AndroidRuntime: Process: Fuse.Preview, PID: 11387
06-21 21:25:34.069 11387 11387 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke interface method 'void com.fusetools.maps.FuseMap$FuseMapCallback.onReady()' on a null object reference
06-21 21:25:34.069 11387 11387 E AndroidRuntime:     at com.fusetools.maps.FuseMap.configure(FuseMap.java:130)
06-21 21:25:34.069 11387 11387 E AndroidRuntime:     at com.fusetools.maps.FuseMap.access$000(FuseMap.java:21)
06-21 21:25:34.069 11387 11387 E AndroidRuntime:     at com.fusetools.maps.FuseMap$1.onMapReady(FuseMap.java:54)
06-21 21:25:34.069 11387 11387 E AndroidRuntime:     at com.google.android.gms.maps.MapView$zza$1.zza(Unknown Source)
06-21 21:25:34.069 11387 11387 E AndroidRuntime:     at com.google.android.gms.maps.internal.zzo$zza.onTransact(Unknown Source)
06-21 21:25:34.069 11387 11387 E AndroidRuntime:     at android.os.Binder.transact(Binder.java:387)
06-21 21:25:34.069 11387 11387 E AndroidRuntime:     at wv.a(:com.google.android.gms.DynamiteModulesB:82)
06-21 21:25:34.069 11387 11387 E AndroidRuntime:     at maps.ag.t$5.run(Unknown Source)
06-21 21:25:34.069 11387 11387 E AndroidRuntime:     at android.os.Handler.handleCallback(Handler.java:739)
06-21 21:25:34.069 11387 11387 E AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:95)
06-21 21:25:34.069 11387 11387 E AndroidRuntime:     at android.os.Looper.loop(Looper.java:148)
06-21 21:25:34.069 11387 11387 E AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417)
06-21 21:25:34.069 11387 11387 E AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)
06-21 21:25:34.069 11387 11387 E AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
06-21 21:25:34.069 11387 11387 E AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-21 21:25:34.914 11387 11996 I b       : Received API Token: AH0uPGEJx7I3RSXjKmmqgRGRE1rUnsNMSGSBHO7EQPHc0kPXBI3kc_Et2amODwZii9eXT2MnT6LV1wdwHFEnFsan5-dem4ktptB0pbJc3HjoCi3RffE0X_FW2MJNmXjpIg_N_wKO67D070VV5kW8s28T52zZHaIO0wsq0o3x8_x0244avfanVi8 / Expires in: 432000000ms
06-21 21:25:34.914 11387 11996 I c       : Scheduling next attempt in 431700 seconds.
06-21 21:25:34.926 11387 11996 I d       : Saved auth token
06-21 21:25:35.094 11387 11399 I art     : Background partial concurrent mark sweep GC freed 14768(1549KB) AllocSpace objects, 6(1056KB) LOS objects, 40% free, 20MB/34MB, paused 5.581ms total 102.441ms
06-21 21:25:35.135 11387 11959 V GoogleSignatureVerifier: Fuse.Preview signature not valid.  Found:

This is due to the preview app being given a different package name than the full build, resulting in an invalid signature, as you can see from the error message Fuse.Preview signature not valid

We’re discussing this internally to find a good approach for this. In the meanwhile, the fix is to add Fuse.Preview as a valid package for your API key in the google developer console

To add Fuse.Preview as a package in the google developer console it asks for a valid SHA-1 certificate fingerprint. How can I get one for fuse?

Didn’t you do this already for your existing API key? You need to print the key from your debug keystore. This is a requirement for using google maps on android in general and Google’s docs go into this.