Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add Plugin with id 'com.novoda.bintray-release' GPUImage

I am trying to import GPUImage in AndroidStudio. So I downloaded the GPUImage library from here https://github.com/CyberAgent/android-gpuimage and then i referred to this link http://pixsterstudio.com/use-gpuimage-library-android-part-1-gpuimage-integration.html to know how i suppose to import the GPUImage library. But then Android studo gives me the following error and it is linked to the library/build.gradle which is posted below.

error message:

Error:(2, 0) Plugin with id 'com.novoda.bintray-release' not found

please let me know how to correct this error and how to to import GPUImage library correctly?

library/build.gradle:

apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

android {
compileSdkVersion COMPILE_SDK_VERSION as int
buildToolsVersion BUILD_TOOLS_VERSION

defaultConfig {
    minSdkVersion MIN_SDK_VERSION as int
    targetSdkVersion TARGET_SDK_VERSION as int

    versionCode "git rev-list origin/master --count".execute().text.toInteger()
    versionName VERSION_NAME

    consumerProguardFiles 'proguard-rules.txt'

    ndk {
        moduleName "gpuimage-library"
        stl "gnustl_shared"
        abiFilters "all"
        ldLibs "log"
    }
}

sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        resources.srcDirs = ['src']
        aidl.srcDirs = ['src']
        renderscript.srcDirs = ['src']
        res.srcDirs = ['res']
        assets.srcDirs = ['assets']
        jni.srcDirs = ['jni']
    }

    instrumentTest.setRoot('tests')
}

lintOptions {
    abortOnError false
}
}

task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}

task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}

artifacts {
archives androidSourcesJar
archives androidJavadocsJar
}

publish {
userOrg = POM_DEVELOPER_ID
groupId = GROUP
artifactId = ARTIFACT_ID
publishVersion = VERSION_NAME
desc = POM_DESCRIPTION
website = POM_URL
}










W/System.err:     at org.opencv.android.OpenCVLoader.initDebug(OpenCVLoader.java:66)
W/System.err:     at org.opencv.android.OpenCVLoader.initDebug(OpenCVLoader.java:66)
W/ContextImpl: Implicit intents with startService are not safe: Intent { act=org.opencv.engine.BIND } android.content.ContextWrapper.bindService:604 org.opencv.android.AsyncServiceHelper.initOpenCV:24 org.opencv.android.OpenCVLoader.initAsync:89 
E/OpenCVLoader/BaseLoaderCallback: OpenCV loading failed!
like image 623
user2121 Avatar asked Nov 17 '16 11:11

user2121


2 Answers

Just add it in built.gradle (Project level)

    classpath 'com.novoda:bintray-release:0.8.0'

under

dependencies {
    classpath 'com.android.tools.build:gradle:3.1.3'
    classpath 'com.google.gms:google-services:4.0.1'
    classpath 'com.novoda:bintray-release:0.8.0'
}

Note: make sure you are adding this dependency at Project level gradle

like image 108
Sheharyar Ejaz Avatar answered Nov 09 '22 13:11

Sheharyar Ejaz


I solved the problem by modifying build.gradle files as shown belwo

build.gradle "project:GPUImageTest00":

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.2.2'
    classpath 'com.novoda:bintray-release:0.3.4'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
    jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

build.gradle "module: app":

apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
defaultConfig {
    applicationId "com.example.gpuimagetest_00"
    minSdkVersion 18
    targetSdkVersion 18
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'
compile project(':library')
}

build.gradle "module: library":

apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

android {
compileSdkVersion 24
buildToolsVersion "24.0.3"

defaultConfig {
    minSdkVersion 18
    targetSdkVersion 18

    versionCode 1
    versionName "1.0"

    consumerProguardFiles 'proguard-rules.txt'

    ndk {
        moduleName "gpuimage-library"
        stl "gnustl_shared"
        abiFilters "all"
        ldLibs "log"
    }
}

sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        resources.srcDirs = ['src']
        aidl.srcDirs = ['src']
        renderscript.srcDirs = ['src']
        res.srcDirs = ['res']
        assets.srcDirs = ['assets']
        jni.srcDirs = []
    }

    instrumentTest.setRoot('tests')
}

lintOptions {
    abortOnError false
}
}

task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}

task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}

artifacts {
archives androidSourcesJar
archives androidJavadocsJar
}

publish {
userOrg = 'novoda'
groupId = 'com.novoda'
artifactId = 'bintray-release'
publishVersion = '0.3.4'
desc = 'Oh hi, this is a nice description for a project, right?'
website = 'https://github.com/novoda/bintray-release'
}

build.gradle Module: sample:

apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "24.0.3"

defaultConfig {
    minSdkVersion 18
    targetSdkVersion 18
}

sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        resources.srcDirs = ['src']
        aidl.srcDirs = ['src']
        renderscript.srcDirs = ['src']
        res.srcDirs = ['res']
        assets.srcDirs = ['assets']
    }

    instrumentTest.setRoot('tests')
}

lintOptions {
    abortOnError true
}
}
repositories {
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}

dependencies {
compile project(':library')
//    compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.4.1'
compile 'com.android.support:appcompat-v7:24.2.1'
}
like image 6
user2121 Avatar answered Nov 09 '22 15:11

user2121