braze-inc / braze-cordova-sdk

Public repo for the Braze Cordova SDK
https://www.braze.com
Other
21 stars 62 forks source link

Should probably pin dependency versions #46

Closed ronkot closed 4 years ago

ronkot commented 4 years ago

I'm not quite sure if this is issue with cordova-plugin-appboy, but here we go 😄

After upgarding cordova-android from 8.0.0 to 8.1.0, the android build failed with with error

A problem occurred evaluating project ':app'.
> Could not resolve all artifacts for configuration 'classpath'.
   > Could not find org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.60-eap-25.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.60-eap-25/kotlin-stdlib-jdk8-1.3.60-eap-25.pom
       - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.60-eap-25/kotlin-stdlib-jdk8-1.3.60-eap-25.jar
       - https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.60-eap-25/kotlin-stdlib-jdk8-1.3.60-eap-25.pom
       - https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.60-eap-25/kotlin-stdlib-jdk8-1.3.60-eap-25.jar
     Required by:
         unspecified:unspecified:unspecified > com.android.tools.build:gradle:4.0.0-alpha01
         unspecified:unspecified:unspecified > com.android.tools.build:gradle:4.0.0-alpha01 > com.android.tools.build:builder:4.0.0-alpha01
         unspecified:unspecified:unspecified > com.android.tools.build:gradle:4.0.0-alpha01 > com.android.tools.lint:lint-gradle-api:27.0.0-alpha01
         unspecified:unspecified:unspecified > com.android.tools.build:gradle:4.0.0-alpha01 > com.android.tools.build:gradle-api:4.0.0-alpha01
         unspecified:unspecified:unspecified > com.android.tools.build:gradle:4.0.0-alpha01 > androidx.databinding:databinding-compiler-common:4.0.0-alpha01
         unspecified:unspecified:unspecified > com.android.tools.build:gradle:4.0.0-alpha01 > com.android.tools.build:builder:4.0.0-alpha01 > com.android.tools:sdk-common:27.0.0-alpha01
         unspecified:unspecified:unspecified > com.android.tools.build:gradle:4.0.0-alpha01 > com.android.tools.build:builder:4.0.0-alpha01 > com.android.tools:common:27.0.0-alpha01
         unspecified:unspecified:unspecified > com.android.tools.build:gradle:4.0.0-alpha01 > com.android.tools.build:builder:4.0.0-alpha01 > com.android.tools.build:manifest-merger:27.0.0-alpha01
         unspecified:unspecified:unspecified > com.android.tools.build:gradle:4.0.0-alpha01 > com.android.tools.build:builder:4.0.0-alpha01 > com.android.tools.analytics-library:tracker:27.0.0-alpha01
         unspecified:unspecified:unspecified > com.android.tools.build:gradle:4.0.0-alpha01 > com.android.tools.build:builder:4.0.0-alpha01 > com.android.tools:sdklib:27.0.0-alpha01 > com.android.tools:repository:27.0.0-alpha01
         unspecified:unspecified:unspecified > com.android.tools.build:gradle:4.0.0-alpha01 > com.android.tools.build:builder:4.0.0-alpha01 > com.android.tools:sdk-common:27.0.0-alpha01 > com.android.tools.analytics-library:shared:27.0.0-alpha01
   > Could not find org.jetbrains.kotlin:kotlin-reflect:1.3.60-eap-25.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-reflect/1.3.60-eap-25/kotlin-reflect-1.3.60-eap-25.pom
       - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-reflect/1.3.60-eap-25/kotlin-reflect-1.3.60-eap-25.jar
       - https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-reflect/1.3.60-eap-25/kotlin-reflect-1.3.60-eap-25.pom
       - https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-reflect/1.3.60-eap-25/kotlin-reflect-1.3.60-eap-25.jar
     Required by:
         unspecified:unspecified:unspecified > com.android.tools.build:gradle:4.0.0-alpha01 > com.android.tools.lint:lint-gradle-api:27.0.0-alpha01
         unspecified:unspecified:unspecified > com.android.tools.build:gradle:4.0.0-alpha01 > com.android.tools.build:builder:4.0.0-alpha01 > com.android.tools:sdk-common:27.0.0-alpha01
   > Could not find org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.60-eap-25.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.60-eap-25/kotlin-stdlib-jdk8-1.3.60-eap-25.pom
       - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.60-eap-25/kotlin-stdlib-jdk8-1.3.60-eap-25.jar
       - https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.60-eap-25/kotlin-stdlib-jdk8-1.3.60-eap-25.pom
       - https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.60-eap-25/kotlin-stdlib-jdk8-1.3.60-eap-25.jar
     Required by:
         unspecified:unspecified:unspecified > com.google.gms:google-services:4.2.0 > com.google.android.gms:strict-version-matcher-plugin:1.1.0

After googling I found that people have had similar problem with cordova-support-google-services plugin. The root cause for the problem was that com.android.tools.build:gradle dependency version was not fixed and the most recent version broke the build (probably due to requiring Kotlin).

As I don't use that plugin I tried to find if I had some other plugin using unpinned com.android.tools.build:gradle dependency and found it from file platforms/android/cordova-plugin-appboy/myapp-build-extras.gradle. When I made the following changes to that file, build succeeded:

- classpath 'com.android.tools.build:gradle:+'
+ classpath 'com.android.tools.build:gradle:3.5.1'

Does this mean that cordova-plugin-appboy should pin the dependency versions or is this a cordova-android issue?

radixdev commented 4 years ago

Thank you for filing this issue. You're correct in that that version should better be pinned. I'll let you know when it gets fixed -> released.

radixdev commented 4 years ago

Hi @ronkot ,

The dependency is now pinned to 3.5.1 in 2.12.0 of the SDK. Thank you for the detailed issue and resolution steps!