Оценок пока нет Ошибки построения Android приложения в проекте на Cordova

Есть 2 самые распространенные виды ошибок, которые возможны при построении приложения Android в проекте Cordova:

  • первое — несоответствие версии платформы и версий плагинов Cordova:
Failed to execute aapt
com.android.ide.common.process.ProcessException: Failed to execute aapt
  • второе — отсутствие кода Gradle для импорта дополнительных сервисов. Это может выглядеть так:
google-services plugin could not detect any version for com.google.android.gms or com.google.firebase, default version: 9.0.0 will be used.
please apply google-services plugin at the bottom of the build file.
  1. Возможное решение первой ошибки — принудительное указание версии добавлением в конец файла android/build.gradle:
configurations.all {
    resolutionStrategy {
        force 'com.android.support:support-v4:27.1.0'
    }
}

2. Возможное решение второй ошибки android/build.gradle:

allprojects {
    repositories {
        ...
        configurations.all {
            resolutionStrategy {
                // Add force (11.4.0 is version you want to use)
                force 'com.google.firebase:firebase-messaging:11.4.0'
                force 'com.google.firebase:firebase-core:11.4.0'
                force 'com.google.android.gms:play-services-gcm:11.4.0'
            }
        }
    }
}

 

Пожалуйста, оцените материал

WebSofter

Web - технологии