Cant build android app


#1

Hi guys, when I try to build my app see this error (2 weeks ago run correctly)

A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugApkCopy'.
   > Could not find any version that matches com.google.android.gms:strict-version-matcher-plugin:11.8.+.
     Versions that do not match:
         1.1.0
         1.0.3
         1.0.2
         1.0.1
         1.0.0
       Searched in the following locations:
         file:/C:/Users/Nuria/AppData/Local/Android/Sdk/extras/google/m2repository/com/google/android/gms/strict-version-matcher-plugin/maven-metadata.xml
         file:/C:/Users/Nuria/AppData/Local/Android/Sdk/extras/google/m2repository/com/google/android/gms/strict-version-matcher-plugin/
         file:/C:/Users/Nuria/Desktop/Iamvo - copia (2)/myApp/platforms/android/sdk-manager/com/google/android/gms/strict-version-matcher-plugin/maven-metadata.xml
         file:/C:/Users/Nuria/Desktop/Iamvo - copia (2)/myApp/platforms/android/sdk-manager/com/google/android/gms/strict-version-matcher-plugin/
         file:/C:/Users/Nuria/AppData/Local/Android/Sdk/extras/android/m2repository/com/google/android/gms/strict-version-matcher-plugin/maven-metadata.xml
         file:/C:/Users/Nuria/AppData/Local/Android/Sdk/extras/android/m2repository/com/google/android/gms/strict-version-matcher-plugin/
         file:/C:/Users/Nuria/Desktop/Iamvo - copia (2)/myApp/platforms/android/sdk-manager/com/google/android/gms/strict-version-matcher-plugin/maven-metadata.xml
         file:/C:/Users/Nuria/Desktop/Iamvo - copia (2)/myApp/platforms/android/sdk-manager/com/google/android/gms/strict-version-matcher-plugin/
     Required by:
         project : > com.google.gms:google-services:4.2.0
```_emphasized text_

#2

First try to completely rebuild your android build.

ionic cordova platform rm android
ionic cordova platform add android

P.s. You might have to update your gradle plugin (Android Studio) too. Just open any Android project in Android Studio (or create just an empty one). You’ll see the syncing process down in the statusbar. Wait for it to finish.


#3

clean your existing build

cordova clean [<platform> [...]]
ex :  cordova clean android

then open sdk manager and

  1. Uninstall android support repository
  2. Install again android support repository

#4

Try, do it and works, but after of this I was update all m plugins https://ionic.zone/cordova/update

Thx


#5

glad to help…:slightly_smiling_face:


#6

Mmmm doesn’t work, don’t generate the output folder in build :S


#7

what errors u are getting


#8

nothing errors… But before I have this error,

 Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:CordovaLib] 

so I was change de minSdkVersion in my config.xml. But If I change it, dont run the build

M ioinic info:

Ionic:

   ionic (Ionic CLI)  : 4.2.1
   Ionic Framework    : ionic-angular 3.5.2
   @ionic/app-scripts : 2.0.2

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.1
   Cordova Plugins       : no whitelisted plugins (16 plugins total)

System:

   Android SDK Tools : 26.1.1 (C:\Users\Nuria\AppData\Local\Android\sdk)
   NodeJS            : v8.10.0 (C:\Program Files\nodejs\node.exe)
   npm               : 5.7.1
   OS                : Windows 10

#9

check this link it might happen if you are using some plugin which should have atleast minimumSdk version 16.


#10

Omg…outfolder was hide… work correctly. Thanks!!!


#11

How did you fix it finally? I’m facing the same problem :tired_face:


#12

update all m plugins [https://ionic.zone/cordova/update] and after rm and install the platform


#13

It didnt work for me, If i try to remove some plugin for update it, the console shows me a weird message:

Uninstalling cordova-plugin-firebase from android
Android Studio project detected
missing file :: app/src/main
Error during processing of action! Attempting to revert...
(node:1121) UnhandledPromiseRejectionWarning: Error: Uh oh!
ENOENT: no such file or directory, open '/Users/smartlogin/Desktop/SmartLogin-android2copia/platforms/android/AndroidManifest.xml'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.readFileSync (fs.js:551:33)
    at Object.parseElementtreeSync (/Users/smartlogin/Desktop/SmartLogin-android2copia/platforms/android/cordova/node_modules/cordova-common/src/util/xml-helpers.js:180:27)
    at new AndroidManifest (/Users/smartlogin/Desktop/SmartLogin-android2copia/platforms/android/cordova/lib/AndroidManifest.js:29:20)
    at AndroidProject.getPackageName (/Users/smartlogin/Desktop/SmartLogin-android2copia/platforms/android/cordova/lib/AndroidProject.js:99:12)
    at AndroidProject.getCustomSubprojectRelativeDir (/Users/smartlogin/Desktop/SmartLogin-android2copia/platforms/android/cordova/lib/AndroidProject.js:105:28)
    at uninstall (/Users/smartlogin/Desktop/SmartLogin-android2copia/platforms/android/cordova/lib/pluginHandlers.js:131:46)
    at ActionStack.process (/Users/smartlogin/Desktop/SmartLogin-android2copia/platforms/android/cordova/node_modules/cordova-common/src/ActionStack.js:56:25)
    at PluginManager.doOperation (/Users/smartlogin/Desktop/SmartLogin-android2copia/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:114:20)
    at PluginManager.removePlugin (/Users/smartlogin/Desktop/SmartLogin-android2copia/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:148:17)
(node:1121) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1121) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

And after that, I can’t even get the same error that I have previously (the one about strict-version-matcher), because I get similar errors to the one that I have shown


#14

I don’t know what is the incorrect plugin. I have this plugins but I dont know what is


PS C:\Users\Nuria\Desktop\Iamvo - copia (2)\myapp> npm outdate
Package                                   Current     Wanted  Latest  Location
@angular/common                             4.1.3      4.1.3   7.0.1  ionic-hello-world
@angular/compiler                           4.1.3      4.1.3   7.0.1  ionic-hello-world
@angular/compiler-cli                       4.1.3      4.1.3   7.0.1  ionic-hello-world
@angular/core                               4.1.3      4.1.3   7.0.1  ionic-hello-world
@angular/forms                              4.1.3      4.1.3   7.0.1  ionic-hello-world
@angular/http                               4.1.3      4.1.3   7.0.1  ionic-hello-world
@angular/platform-browser                   4.1.3      4.1.3   7.0.1  ionic-hello-world
@angular/platform-browser-dynamic           4.1.3      4.1.3   7.0.1  ionic-hello-world
@ionic-native/admob-pro                     4.5.3     4.16.0  4.16.0  ionic-hello-world
@ionic-native/app-version                   4.6.0     4.16.0  4.16.0  ionic-hello-world
@ionic-native/camera                        4.3.0     4.16.0  4.16.0  ionic-hello-world
@ionic-native/core                         3.14.0     3.14.0  4.16.0  ionic-hello-world
@ionic-native/diagnostic                    4.5.3     4.16.0  4.16.0  ionic-hello-world
@ionic-native/dialogs                       4.6.0     4.16.0  4.16.0  ionic-hello-world
@ionic-native/email-composer                4.5.3     4.16.0  4.16.0  ionic-hello-world
@ionic-native/facebook                      4.3.0     4.16.0  4.16.0  ionic-hello-world
@ionic-native/firebase                      4.6.0     4.16.0  4.16.0  ionic-hello-world
@ionic-native/geolocation                   4.2.1     4.16.0  4.16.0  ionic-hello-world
@ionic-native/market                        4.6.0     4.16.0  4.16.0  ionic-hello-world
@ionic-native/onesignal                     4.6.0     4.16.0  4.16.0  ionic-hello-world
@ionic-native/splash-screen                3.12.1     3.12.1  4.16.0  ionic-hello-world
@ionic-native/status-bar                   3.12.1     3.12.1  4.16.0  ionic-hello-world
@ionic/app-scripts                          2.0.2      2.0.2   3.2.0  ionic-hello-world
@ionic/cli-utils                           1.10.2     1.19.3   2.2.1  ionic-hello-world
@ionic/storage                              2.0.1      2.0.1   2.2.0  ionic-hello-world
ajv                                         5.2.2      5.5.2   6.5.4  ionic-hello-world
angularfire2                            4.0.0-rc0  4.0.0-rc0   5.1.0  ionic-hello-world
cordova-android                             6.3.0      6.3.0   7.1.1  ionic-hello-world
cordova-android-support-gradle-release      1.2.1      1.4.5   1.4.5  ionic-hello-world
cordova-plugin-admobpro                    2.31.1     2.35.3  2.35.3  ionic-hello-world
cordova-plugin-camera                       2.4.1      2.4.1   4.0.3  ionic-hello-world
cordova-plugin-device                       1.1.7      1.1.7   2.0.2  ionic-hello-world
cordova-plugin-facebook4                    1.9.1     1.10.1   3.1.0  ionic-hello-world
cordova-plugin-firebase                    0.1.25     0.1.25   2.0.5  ionic-hello-world
cordova-plugin-splashscreen                 4.1.0      4.1.0   5.0.2  ionic-hello-world
cordova-plugin-statusbar                    2.4.1      2.4.2   2.4.2  ionic-hello-world
cordova.plugins.diagnostic                  4.0.3     4.0.10  4.0.10  ionic-hello-world
device                                      0.3.8      0.3.9   0.3.9  ionic-hello-world
firebase                                    3.9.0      3.9.0   5.5.6  ionic-hello-world
ionic                                      3.20.0     3.20.0   4.2.1  ionic-hello-world
ionic-angular                               3.5.2      3.5.2   3.9.2  ionic-hello-world
ionicons                                    3.0.0      3.0.0   4.4.6  ionic-hello-world
onesignal-cordova-plugin                    2.3.3      2.4.4   2.4.4  ionic-hello-world
promise-polyfill                            6.1.0      6.1.0   8.1.0  ionic-hello-world
rxjs                                        5.4.0      5.4.0   6.3.3  ionic-hello-world
typescript                                  2.3.4      2.3.4   3.1.4  ionic-hello-world
zone.js                                    0.8.12     0.8.12  0.8.26  ionic-hello-world

#15

Hello,

In my case, I found that cordova-plugin-firebase had a confilct with another plugin with the framework “com.google.gms:google-services”.

So, first I went to plugins > cordova-plugin-firebase > plugin.xml, then i changed the line <framework src=“com.google.gms:google-services:+” /> for <framework src=“com.google.gms:google-services:4.2.0” />

When i did this changed, the compile process throw an error with de java version, then i went to platforms > android > build.gradle i changed
sourceCompatibility JavaVersion.VERSION_1_6
targetCompatibility JavaVersion.VERSION_1_6
for
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8

and because this java version use Jack, so i had to add
jackOptions {
enabled true
}
in the defaultConfig space.

It worked for me.
I hope to help you.
Regards!


#16

I have same issue here, I’ve tried 2 solution above

  1. Cordova clean android and re install android support repository
    but error when try to “cordova clean android”

  2. and gonzalogobea solutiond, but still not work for me,.,.

any one have other solutions?

I’ve searched the solution for 3 days but no progress, please help me

here my error

A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugApkCopy'.
   > Could not find any version that matches com.google.android.gms:strict-version-matcher-plugin:11.2.+.
     Versions that do not match:
         1.1.0
         1.0.3
         1.0.2
         1.0.1
         1.0.0
     Searched in the following locations:

#17

Thanks for sharing this i too was getting that same issue while building ionic application development with android.