MapView fails on preview

Hi!

I’m playing around with `MapView, which I know has worked before. But now it seems to fail when compiling for preview.

This is the output from fuse preview -t android

C:\Users\joms9\Documents\Fuse\MapTest>fuse preview -t android
Build started: FullCompile
Configuring (3.46s)
Compiling syntax tree (6.39s)
Generating code and data (20.10s)
Building Android app
1/2: libMapTest.so
2/2: MapTest.apk
     [aapt] C:\Users\joms9\Documents\Fuse\MapTest\build\Android\Preview\MapTest\app\src\main\bin\AndroidManifest.xml:59: error: Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version').

BUILD FAILED
C:\ProgramData\Uno\SDKs\AndroidSDK\tools\ant\build.xml:653: The following error occurred while executing this line:
C:\ProgramData\Uno\SDKs\AndroidSDK\tools\ant\build.xml:698: null returned: 1

Total time: 0 seconds
(unknown): E0200: Android build failed -- rerun with '-v' for more information
?: Error E0200: Android build failed -- rerun with '-v' for more information
(73.87s)

Build completed in 103.83 seconds.
    0 Warning(s)
    1 Error(s)
Checking if C:\Program Files\Java\jdk1.8.0_40 exists.
C:\Program Files\Java\jdk1.8.0_40 was found.
Checking if JDK is corrupt
jdk was found.
Checking if C:\ProgramData\Uno\SDKs\AndroidSDK exists.
C:\ProgramData\Uno\SDKs\AndroidSDK was found.
Checking if C:\ProgramData\Uno\SDKs\AndroidSDK\tools exists.
C:\ProgramData\Uno\SDKs\AndroidSDK\tools was found.
Checking if Android SDK is corrupt.
Checking if all required Android components are installed.
androidsdk was found.
Checking if C:\ProgramData\Uno\SDKs\AndroidNDK\ndk-build exists.
C:\ProgramData\Uno\SDKs\AndroidNDK\ndk-build was found.
Checking if C:\ProgramData\Uno\SDKs\AndroidNDK\toolchains exists.
C:\ProgramData\Uno\SDKs\AndroidNDK\toolchains was found.
Checking if C:\ProgramData\Uno\SDKs\AndroidNDK\prebuilt exists.
C:\ProgramData\Uno\SDKs\AndroidNDK\prebuilt was found.
androidndk was found.
Checking if C:\ProgramData\Uno\SDKs\Ant exists.
C:\ProgramData\Uno\SDKs\Ant was found.
Checking if Ant is corrupt
ant was found.
Build ended
fuse: Failed to compile project

MapTest.unoproj

{
  "RootNamespace":"",
  "Packages": [
        "Fuse.Animations",
        "Fuse.BasicTheme",
        "Fuse.Themes",
        "Fuse.Controls",
        "Fuse.Designer",
        "Fuse.Drawing",
        "Fuse.Drawing.Primitives",
        "Fuse.Effects",
        "Fuse.Elements",
        "Fuse.Entities",
        "Fuse.Gestures",
        "Fuse.Navigation",
        "Fuse.Scripting",
        "Fuse.Shapes",
        "Fuse.Triggers",
        "Fuse.Reactive",
        "Fuse.Android",
        "Fuse.Desktop",
        "Fuse.iOS",
        "Fuse.UserEvents",
        "FuseCore",
        "Uno.Collections",
        "Uno.Geometry"
  ],
  "Includes": [
    "*"
  ],
  "Android": {
    "Geo": {
        "ApiKey": "my-secret-key"
      }
  }
}

Does it work when you do regular builds? If not then please provide the log output from doing fuse build -tandroid -v

Have you verified that other projects work in Android preview (e.g. that it’s actually the mapview that leads to issues)?

And which Fuse version are you on?

When investigating closer, this seems to happen when I add the ApiKey to the unoproj file and not the <MapView /> tag by itself.

I’m running v 0.12.3.

Output from running fuse build -tandroid -v: http://pastebin.com/0LtXpcu1

Try adding Fuse.Maps to the packages in your unoproj. It seems like having an api key without referencing the package can cause the error you’re seeing.

That makes sense! Now it works :slight_smile:

I guess automatic import of packages would be a nice feature so I don’t run into these embarrassments again.