Open jkasten2 opened 6 years ago
@jkasten2 does this jive with what the support library team is suggesting here https://developer.android.com/topic/libraries/support-library/index.html#api-versions ?
If we want to apply special logic around a dependency like this perhaps somewhere this could be applied is in https://github.com/googlesamples/unity-jar-resolver/blob/master/source/PlayServicesResolver/scripts/download_artifacts.gradle ?
@stewartmiles The link talks about minimum API level, it doesn't bring up the compile SDK version though. Actually wasn't able to find a reference to the specific limitation of compileSdkVersion
and com.android.support
in any of the Google docs online docs. However this error is shown in Android Studio:
It notes 'different' but I don't believe there will be an issue with the compileSdkVersion
being greater than com.android.support
. Only when compileSdkVersion
is less than com.android.support
as it's can refer to classes or resource names that isn't in the compile version referenced.
I might have so time to dig into this in the next week or 2. I see there is also a nice quick and easy to run test for this file ./gradlew test_downloadArtifacts
that runs for me.
I am having some trouble with a full build however running ./gradlew build --info
. I'll open a 2nd issue for this with more detail though, to keep this issue on a single topic.
+1 on this, as it has been making my life hell the past few days.
Fyi @jkasten2 there is a 4th option, which is to create mainTemplate.gradle from Player Settings and override compileSdkVersion there instead of having to export!
Issue
This resolver plugin should limit the upper bounds of all modules under the
com.android.support
group to matchcompileSdkVersion
. Example ifcom.android.support
revision 26 is used when Unity usescompileSdkVersion
of 25 the following build error occurs.Example Error 1
com.android.support = 26
compileSdkVersion = 25
Example Error 2
com.android.support = 27.1.1
compileSdkVersion = 25
Reproducing Issue
This is reproducible by using the following:
Unity 2017.4.0f1
(Exact version probably not needed)File
>Build Settings..
>Player Settings...
>Target API Level
Android 7.1 'Nougat' (API Level 25)
Or lowerplay-services-resolver-1.2.64.0.unitypackage
OneSignalSDK.unitypackage - version 2.6.4
or any*Dependencies.xml
file like OneSignal'sWork Arounds
Option 1
Unity 2017.4.0f1
, might work on older versionsFile
>Build Settings..
>Player Settings...
>Target API Level
Automatic (highest installed)
Option 2
File
>Build Settings..
app/build.gradle
updatecompileSdkVersion
to 27.Option 3
*Dependencies.xml
files in your project<androidPackage spec="com.android.support:
File
>Build Settings..
>Player Settings...
>Target API Level