Android build fails when adding the plugin
See original GitHub issueHi,
Build on Android fails on my side after I add the plugin. Here are steps to reproduce:
- Checkout sampleGroceries app:
git clone git@github.com:NativeScript/sample-Groceries.git
- Checkout βstartβ branch:
git checkout start
- Add android platform:
tns platform add android
- Add the plugin:
tns plugin add nativescript-google-maps-sdk
- 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:
- Created 7 years ago
- Comments:9 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Maybe try installing
Google Respository
in your SDK manager.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.
It works for me π