Javacpp-presets: Gradle file not compile on Windows 10 in Android Studio

Created on 16 May 2016  ·  16Comments  ·  Source: bytedeco/javacpp-presets

we are using bytedeco version 1.1 in Android Studio on Windows 10 and from this morning it doesn't compile anymore. This is the error:

Error:A problem occurred configuring project ':app'.
Could not find javacpp-presets-Windows 10-amd64.jar (org.bytedeco:javacpp-presets:1.2).
Searched in the following locations:
https://jcenter.bintray.com/org/bytedeco/javacpp-presets/1.2/javacpp-presets-1.2-Windows 10-amd64.jar"

what can we do? Thank you

bug duplicate question

Most helpful comment

Found a workaround. Add this to your gradle.build file:

configurations {
    all*.exclude group: 'org.bytedeco', module: 'javacpp-presets'
}

Marking as duplicate of https://github.com/bytedeco/javacv/issues/395

All 16 comments

Could you try to set the javacpp.platform system property to "android-arm" or "android-x86"?

what do you mean? Sorry, but I don't understand

'You can also add properties to your project objects using properties files. You can place a gradle.properties file in the Gradle user home directory (defined by the “GRADLE_USER_HOME” environment variable, which if not set defaults to USER_HOME/.gradle) or in your project directory.':
https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_properties_and_system_properties

Actually this part:
'You can also set system properties in the gradle.properties file. If a property name in such a file has the prefix “systemProp.”, like “systemProp.propName”, then the property and its value will be set as a system property, without the prefix.':
https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_properties_and_system_properties'

Sorry but I'm not an expert. I cannot follow your suggestion. I can post a piece of my "build.gradle Module:app"

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'org.bytedeco:javacv:1.1'
compile 'org.bytedeco:javacv:+'
compile 'org.bytedeco.javacpp-presets:opencv:2.4.10-0.10'
compile 'org.bytedeco.javacpp-presets:ffmpeg:2.8.1-0.10'
}

what do I have to modify?

try this:

compile group: 'org.bytedeco', name: 'javacv', version: '1.1'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.0.0-1.1', classifier: 'android-arm'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '2.8.1-1.1', classifier: 'android-arm'

add this too inside android{} :

packagingOptions {
    exclude 'META-INF/services/javax.annotation.processing.Processor'
    pickFirst  'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.properties'
    pickFirst  'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.xml'
    pickFirst  'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.properties'
    pickFirst  'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.xml'
}

if you have x86 device change "classifier: 'android-arm" to "classifier: 'android-x86"

now work! Thank you very much!

It doesn't work for 1.2 version though.

compile group: 'org.bytedeco', name: 'javacv', version: '1.2'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.1.0-1.2', classifier: 'android-arm'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.0.2-1.2', classifier: 'android-arm'

Getting error:

Error:A problem occurred configuring project ':app'.
Could not find javacpp-presets-Windows 10-amd64.jar (org.bytedeco:javacpp-presets:1.2).
Searched in the following locations:
https://jcenter.bintray.com/org/bytedeco/javacpp-presets/1.2/javacpp-presets-1.2-Windows 10-amd64.jar

@yevreinov What happens if you set the javacpp.platform.dependency system property to false?

Added javacpp.platform.dependency=false to gradle.properties
Error is still there.

@yevreinov Try to add it as a system property instead:

You can also set system properties in the gradle.properties file. If a property name in such a file has the prefix “systemProp.”, like “systemProp.propName”, then the property and its value will be set as a system property, without the prefix.

https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_properties_and_system_properties'

Changed to systemProp.javacpp.platform.dependency=false in the same file.
No result I'm afraid.

@yevreinov please report it upstream as a bug. According to Gradle's spec that definitely should not happen:

Profiles that are active on the absence of a system property
http://gradle.org/blog/feature-spotlight-gradles-support-maven-pom-profiles/

Found a workaround. Add this to your gradle.build file:

configurations {
    all*.exclude group: 'org.bytedeco', module: 'javacpp-presets'
}

Marking as duplicate of https://github.com/bytedeco/javacv/issues/395

Thank you! This has fixed it.

@saudet Thanks Shmual, the workaround are working. :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

blueberry picture blueberry  ·  34Comments

siddharthmudgal picture siddharthmudgal  ·  26Comments

blueberry picture blueberry  ·  32Comments

oneengineer picture oneengineer  ·  34Comments

mmanco picture mmanco  ·  20Comments