Repository navigation
Gradle cache causing conflicts with the original library #430
Copy link
Copy link
Closed
Labels
Description
Activity
If I use a different version of the SDK I get:
:buildMetadata Exception in thread "main" java.lang.IllegalArgumentException: Class com.tns.internal.AppBuilderCallback conflict: C:\Users\George\nativescript-plugin-seed-master\demo\platforms\android\build\intermediates\classes\yourplugin\debug and C:\Users\George\nativescript-plugin-seed-master\demo\platforms\android\build\intermediates\classes\nativescriptazure\debug at com.telerik.metadata.ClassRepo.cacheJarFile(ClassRepo.java:21) at com.telerik.metadata.Builder.build(Builder.java:41) at com.telerik.metadata.Generator.main(Generator.java:44) :buildMetadata FAILEDHi @georgeedwards,
The reason behind this error:Exception in thread "main" java.lang.IllegalArgumentException: Class com.microsoft.windowsazure.mobileservices.table.query.FunctionCallNodeMerger conflict: /Users/georgeedwards/.gradle/caches/modules-2/files-2.1/com.microsoft.azure/azure-mobile-android/3.1.0/ae6cfa31ba5a84141676d2d92fa64ca36c52d28/azure-mobile-android-3.1.0.jar and /Users/georgeedwards/Desktop/nativescript-plugin-seed-master/demo/node_modules/nativescript-yourplugin/platforms/android/azure-mobile-android-3.1.0.jar at com.telerik.metadata.ClassRepo.cacheJarFile(ClassRepo.java:21) at com.telerik.metadata.Builder.build(Builder.java:38) at com.telerik.metadata.Generator.main(Generator.java:44) :buildMetadata FAILEDIs that there are two jars that define the same types. (in the common scenario these jars are the same).
I couldn't reproduce your problem, but i tried adding theasurelibrary you're using to the project, like so:- go to
/app/App_Resources/Android/ - open
app.gradle - uncomment the
dependenciesconfiguration and replace the example string withcom.microsoft.azure:azure-mobile-android:3.1.0
(your file should look like this:)
dependencies { compile 'com.microsoft.azure:azure-mobile-android:3.1.0' } android { defaultConfig { generatedDensities = [] } aaptOptions { additionalParameters "--no-version-vectors" } }- run the build
tns run android
For the second error:
:buildMetadata Exception in thread "main" java.lang.IllegalArgumentException: Class com.tns.internal.AppBuilderCallback conflict: C:\Users\George\nativescript-plugin-seed-master\demo\platforms\android\build\intermediates\classes\yourplugin\debug and C:\Users\George\nativescript-plugin-seed-master\demo\platforms\android\build\intermediates\classes\nativescriptazure\debug at com.telerik.metadata.ClassRepo.cacheJarFile(ClassRepo.java:21) at com.telerik.metadata.Builder.build(Builder.java:41) at com.telerik.metadata.Generator.main(Generator.java:44) :buildMetadata FAILEDYou need to do a clean after you change a dependency like the SDK.
You can do that in two ways:- go to
platforms/android/and running the command:gradlew cleanfor windows and./gradlew cleanfor linux. - go to
platforms/android/and delete thebuildfolder.
PS: soon there will be a
tns android cleancommand that will do this job for your.Reacted by m.b., Lorchelio and Erkan Arslan- go to
Ahh, that's solved it - Thanks!
I am building a Nativescript plugin, for android. When I add the Azure-Mobile-SDK (
azure-mobile-android-3.1.0.jar), I get the following error:It looks as though the cached version is conflicting with my original library and causing my build to fail - why is this happening and how can I stop it?
Update, if I don't list the library in my
include.gradle, then I get the following output:But it builds successfully - any ideas why the include is an issue?