question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android build fails when adding the plugin

See original GitHub issue

Hi,

Build on Android fails on my side after I add the plugin. Here are steps to reproduce:

  1. Checkout sampleGroceries app: git clone git@github.com:NativeScript/sample-Groceries.git
  2. Checkout β€œstart” branch: git checkout start
  3. Add android platform: tns platform add android
  4. Add the plugin: tns plugin add nativescript-google-maps-sdk
  5. Build: tns build android

Here is the error:

WARNING: The file: /Users/ickata/Desktop/Tables/tns/sample-Groceries/node_modules/nativescript-google-maps-sdk/platforms/android/AndroidManifest.xml is depricated, you can read more about what will be the expected plugin structure here: https://www.nativescript.org/blog/migrating-n-android-plugins-from-version-1.7-to-2.0
WARNING: The file: /Users/ickata/Desktop/Tables/tns/sample-Groceries/node_modules/nativescript-google-maps-sdk/platforms/android/res/values/nativescript_google_maps_api.xml is depricated, you can read more about what will be the expected plugin structure here: https://www.nativescript.org/blog/migrating-n-android-plugins-from-version-1.7-to-2.0

:config phase:  createDefaultIncludeFiles
    +found plugins: nativescript-google-maps-sdk
Renaming plugin directory to flavor name: /Users/ickata/Desktop/Tables/tns/sample-Groceries/platforms/android/src/nativescript-google-maps-sdk -> /Users/ickata/Desktop/Tables/tns/sample-Groceries/platforms/android/src/F0
    +found plugins: tns-core-modules-widgets
Renaming plugin directory to flavor name: /Users/ickata/Desktop/Tables/tns/sample-Groceries/platforms/android/src/tns-core-modules-widgets -> /Users/ickata/Desktop/Tables/tns/sample-Groceries/platforms/android/src/F1

:config phase:  createPluginsConfigFile
     Creating product flavors include.gradle file in /Users/ickata/Desktop/Tables/tns/sample-Groceries/platforms/android/configurations folder...

:config phase:  pluginExtend
    +applying configuration from: /Users/ickata/Desktop/Tables/tns/sample-Groceries/platforms/android/configurations/include.gradle
    +applying configuration from: /Users/ickata/Desktop/Tables/tns/sample-Groceries/platforms/android/configurations/nativescript-google-maps-sdk/include.gradle
    +applying configuration from: /Users/ickata/Desktop/Tables/tns/sample-Groceries/platforms/android/configurations/tns-core-modules-widgets/include.gradle

:config phase:  copyAarDependencies

:config phase:  addAarDependencies
    +adding dependency: /Users/ickata/Desktop/Tables/tns/sample-Groceries/platforms/android/libs/aar/widgets-release.aar

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'sampleGroceries'.
> Could not resolve all dependencies for configuration ':_F0F1DebugCompile'.
   > Could not find any matches for com.google.android.gms:play-services-maps:+ as no versions of com.google.android.gms:play-services-maps are available.
     Searched in the following locations:
         https://jcenter.bintray.com/com/google/android/gms/play-services-maps/maven-metadata.xml
         https://jcenter.bintray.com/com/google/android/gms/play-services-maps/
         file:/Users/ickata/Desktop/Tables/tns/sample-Groceries/platforms/android/libs/aar/
         file:/usr/local/opt/android-sdk/extras/android/m2repository/com/google/android/gms/play-services-maps/maven-metadata.xml
         file:/usr/local/opt/android-sdk/extras/android/m2repository/com/google/android/gms/play-services-maps/
     Required by:
         :sampleGroceries:unspecified

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 8.026 secs
Command /Users/ickata/Desktop/Tables/tns/sample-Groceries/platforms/android/gradlew failed with exit code 1
# build android
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Usage   β”‚ Synopsis                                                                                                                                                                                 β”‚
β”‚ General β”‚ $ tns build android [--compileSdk <API Level>] [--key-store-path <File Path> --key-store-password <Password> --key-store-alias <Name> --key-store-alias-password <Password>] [--release] β”‚
β”‚         β”‚ [--static-bindings] [--copy-to <File Path>]                                                                                                                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Builds the project for Android and produces an APK that you can manually deploy on device or in the native emulator.

### Options

    * --compileSdk - Sets the Android SDK that will be used to build the project.
    * --release - If set, produces a release build. Otherwise, produces a debug build. When set, you must also specify the --key-store-* options.
    * --key-store-path - Specifies the file path to the keystore file (P12) which you want to use to code sign your APK. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-password - Provides the password for the keystore file specified with --key-store-path. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-alias - Provides the alias for the keystore file specified with --key-store-path. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-alias-password - Provides the password for the alias specified with --key-store-alias-password. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --copy-to - Specifies the file path where the built .apk will be copied. If it points to a non-existent directory, it will be created. If the specified value is directory, the original file name will be used.

### Attributes
<API Level> is a valid Android API level. For example: 22, 23.

Before adding the plugin I was able to build for android and to run the demo app in the emulator. So my setup should be fine.

Let me know if you need additional information.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dapriettcommented, Jul 6, 2016

Maybe try installing Google Respository in your SDK manager.

0reactions
esshx8commented, Aug 22, 2018

C:\Users\user\AndroidStudioProjects\FunFacts\app\src\main\res\values\dimens.xml: Error: In DataSet β€˜main’, no data file for changedFile. This is an internal error in the incremental builds code; to work around it, try doing a full clean build.

Scott Junner on May 12, 2017 If you open the Build menu at the top of AndroidStudio, you will see two options there of interest to you. β€œClean Project” and β€œRebuild Project”. Try those one after the other and see what results you get. Other than that I don’t really know.

It works for me πŸ˜ƒ

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android add-to-app build fails when using platform plugin that ...
When building an existing app and embedding flutter, and using the latest version of the url_launcher plugin, the build will fail becauseΒ ...
Read more >
Known issues with Android Studio and Android Gradle Plugin
To fix the issue for the current project, click Run > Edit Configurations and change the default JUnit configuration to only include the...
Read more >
Build failed in add firebase when added apply plugin
When i added this line apply plugin: 'com.google.gms.google-services' in build.gradle(:app) for add Firebase to my Android app , i faced withΒ ...
Read more >
Failed to apply plugin 'com.android.internal.application' | Flutter
This is a short tutorial video on how to fix the build error " Failed to apply plugin 'com. android.internal.application'. Android Gradle plugin...
Read more >
[OneSignal Plugin] Android Build Error - OutSystems
OneSignal Plugin Error when generating Android mobile app. Says ". The following errors have occurred:β€’ In Android on 2019-05-17 at 08:43:25 - An...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found