{"action":"created","issue":{"url":"https://api.github.com/repos/bytedeco/javacpp-presets/issues/303","repository_url":"https://api.github.com/repos/bytedeco/javacpp-presets","labels_url":"https://api.github.com/repos/bytedeco/javacpp-presets/issues/303/labels{/name}","comments_url":"https://api.github.com/repos/bytedeco/javacpp-presets/issues/303/comments","events_url":"https://api.github.com/repos/bytedeco/javacpp-presets/issues/303/events","html_url":"https://github.com/bytedeco/javacpp-presets/issues/303","id":183205975,"number":303,"title":"aar dependency not working","user":{"login":"matart15","id":17027219,"avatar_url":"https://avatars.githubusercontent.com/u/17027219?v=3","gravatar_id":"","url":"https://api.github.com/users/matart15","html_url":"https://github.com/matart15","followers_url":"https://api.github.com/users/matart15/followers","following_url":"https://api.github.com/users/matart15/following{/other_user}","gists_url":"https://api.github.com/users/matart15/gists{/gist_id}","starred_url":"https://api.github.com/users/matart15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matart15/subscriptions","organizations_url":"https://api.github.com/users/matart15/orgs","repos_url":"https://api.github.com/users/matart15/repos","events_url":"https://api.github.com/users/matart15/events{/privacy}","received_events_url":"https://api.github.com/users/matart15/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bytedeco/javacpp-presets/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-15T11:59:30Z","updated_at":"2016-10-17T03:18:09Z","closed_at":null,"body":"Then i tried to make this app(https://github.com/CrazyOrr/FFmpegRecorder) into aar library and call it from myApplication.\r\nThis library uses ffmpeg as dependency.\r\n\r\nstructure is something like this\r\n\r\n`JavaCV.jar -> FFmpegRecorder.aar -> myApplication`\r\n\r\nBut app can't find dependency of aar.\r\n\r\n```\r\njava.lang.UnsatisfiedLinkError: org.bytedeco.javacpp.avcodec\r\n                                                     at java.lang.Class.classForName(Native Method)\r\n                                                     at java.lang.Class.forName(Class.java:324)\r\n                                                     at org.bytedeco.javacpp.Loader.load(Loader.java:413)\r\n                                                     at org.bytedeco.javacpp.Loader.load(Loader.java:381)\r\n                                                     at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1650)\r\n                                                     at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149)\r\n                                                     at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:129)\r\n                                                     at com.example.matar.testapplication.FFmpegRecordActivity.initRecorder(FFmpegRecordActivity.java:337)\r\n                                                     at com.example.matar.testapplication.FFmpegRecordActivity.access$000(FFmpegRecordActivity.java:50)\r\n                                                     at com.example.matar.testapplication.FFmpegRecordActivity$2.run(FFmpegRecordActivity.java:162)\r\n```\r\n\r\nI already tried this and `{transitive=true}`\r\nhttp://stackoverflow.com/questions/34872382/manually-adding-aar-with-dependency-pom-iml-file\r\n\r\nWhat am i doing wrong\r\n\r\n\r\nThis is my build.gradle to create aar file \r\n```\r\napply plugin: 'com.android.library'\r\napply plugin: 'maven-publish'\r\napply plugin: 'maven'\r\n//apply plugin: 'com.android.application'\r\n\r\nandroid {\r\n    compileSdkVersion 23\r\n    buildToolsVersion \"23.0.0\"\r\n\r\n    defaultConfig {\r\n        minSdkVersion 14\r\n        targetSdkVersion 22\r\n    }\r\n    buildTypes {\r\n        release {\r\n            minifyEnabled false\r\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\r\n        }\r\n    }\r\n}\r\n\r\ndependencies {\r\n//    compile fileTree(dir: 'libs', include: ['*.jar'])\r\n    testCompile 'junit:junit:4.12'\r\n    compile 'com.android.support:appcompat-v7:23.3.0'\r\n    compile 'com.jakewharton:butterknife:7.0.1'\r\n//    compile files('libs/ffmpeg.jar')\r\n//    compile files('libs/javacpp.jar')\r\n//    compile files('libs/javacv.jar')\r\n\r\n    compile group: 'org.bytedeco', name: 'javacv', version: '1.1'\r\n    compile group: 'org.bytedeco', name: 'javacpp', version: '1.1'\r\n    compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.0.0-1.1', classifier: 'android-arm'\r\n    compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '2.8.1-1.1', classifier: 'android-arm'\r\n\r\n}\r\n\r\nuploadArchives {\r\n    repositories{\r\n        mavenDeployer {\r\n            pom.groupId = 'com.example.matar'\r\n            pom.artifactId = 'testapplication'\r\n            pom.version = '0.0.1-SNAPSHOT'\r\n            // Add other pom properties here if you want (developer details / licenses)\r\n            repository(url: \"file://${System.env.HOME}/.m2/repository/\")\r\n        }\r\n    }\r\n}\r\npublishing {\r\n    publications {\r\n        maven(MavenPublication) {\r\n            groupId 'com.example.matar' //You can either define these here or get them from project conf elsewhere\r\n            artifactId 'testapplication'\r\n            version '0.0.1-SNAPSHOT'\r\n            artifact \"$buildDir/outputs/aar/app-release.aar\" //aar artifact you want to publish\r\n\r\n            //generate pom nodes for dependencies\r\n            pom.withXml {\r\n                def dependenciesNode = asNode().appendNode('dependencies')\r\n                configurations.compile.allDependencies.each { dependency ->\r\n                    def dependencyNode = dependenciesNode.appendNode('dependency')\r\n                    dependencyNode.appendNode('groupId', dependency.group)\r\n                    dependencyNode.appendNode('artifactId', dependency.name)\r\n                    dependencyNode.appendNode('version', dependency.version)\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    //publish to filesystem repo\r\n    repositories{\r\n        maven {\r\n            url \"$buildDir/repo\"\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nhere is my application using this aar\r\n\r\n```\r\npackage com.example.matar.myapplication;\r\n\r\nimport android.content.Intent;\r\nimport android.support.v7.app.AppCompatActivity;\r\nimport android.os.Bundle;\r\n\r\npublic class MainActivity extends AppCompatActivity {\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        setContentView(R.layout.activity_main);\r\n\r\n        Intent intent = new Intent(this, com.example.matar.testapplication.FFmpegRecordActivity.class);\r\n        intent.addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK);\r\n        startActivity(intent);\r\n    }\r\n}\r\n```\r\n```\r\napply plugin: 'com.android.application'\r\n//apply plugin: 'com.android.library'\r\n\r\nandroid {\r\n    compileSdkVersion 24\r\n    buildToolsVersion \"24.0.0\"\r\n    defaultConfig {\r\n        applicationId \"com.example.matar.myapplication\"\r\n        minSdkVersion 15\r\n        targetSdkVersion 24\r\n        versionCode 1\r\n        versionName \"1.0\"\r\n        testInstrumentationRunner \"android.support.test.runner.AndroidJUnitRunner\"\r\n    }\r\n    buildTypes {\r\n        release {\r\n            minifyEnabled false\r\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\r\n        }\r\n    }\r\n}\r\nallprojects {\r\n    repositories {\r\n        jcenter()\r\n        flatDir {\r\n            dirs 'libs'\r\n        }\r\n//        maven {\r\n//            url \"file://${System.env.HOME}/.m2/repository/\"\r\n//        }\r\n//        maven {\r\n//            url \"/Users/matar/workplace/android/test/TestApplication/app/build/repo\"\r\n//        }\r\n    }\r\n}\r\n\r\ndependencies {\r\n//    compile fileTree(include: ['*.jar'], dir: 'libs')\r\n    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {\r\n        exclude group: 'com.android.support', module: 'support-annotations'\r\n    })\r\n    compile 'com.android.support:appcompat-v7:24.2.1'\r\n    testCompile 'junit:junit:4.12'\r\n    compile(name:'app-release', ext:'aar'){ transitive = true }\r\n\r\n    compile group: 'org.bytedeco', name: 'javacv', version: '1.1'\r\n    compile group: 'org.bytedeco', name: 'javacpp', version: '1.1'\r\n    compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.0.0-1.1', classifier: 'android-arm'\r\n    compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '2.8.1-1.1', classifier: 'android-arm'\r\n\r\n//    compile ('com.example.matar:testapplication:0.0.1-SNAPSHOT@aar'){transitive=true}\r\n}\r\n```\r\n\r\n------\r\nI also tried copying `*.so` files too\r\n\r\nMy *.so files are in `app/src/main/jniLibs/armeabi` just like this.\r\nhttps://github.com/CrazyOrr/FFmpegRecorder/tree/master/app/src/main/jniLibs/armeabi\r\n\r\nand they work with this case\r\nJavaCV.jar -> FFmpegRecorder as application\r\n\r\nand does not work with this case\r\nJavaCV.jar -> FFmpegRecorder.aar -> myApplication as application\r\n\r\nI copied *.so files to `app/src/main/jniLibs/armeabi` directory of both ` FFmpegRecorder.aar` and `myApplication`."},"comment":{"url":"https://api.github.com/repos/bytedeco/javacpp-presets/issues/comments/254103820","html_url":"https://github.com/bytedeco/javacpp-presets/issues/303#issuecomment-254103820","issue_url":"https://api.github.com/repos/bytedeco/javacpp-presets/issues/303","id":254103820,"user":{"login":"matart15","id":17027219,"avatar_url":"https://avatars.githubusercontent.com/u/17027219?v=3","gravatar_id":"","url":"https://api.github.com/users/matart15","html_url":"https://github.com/matart15","followers_url":"https://api.github.com/users/matart15/followers","following_url":"https://api.github.com/users/matart15/following{/other_user}","gists_url":"https://api.github.com/users/matart15/gists{/gist_id}","starred_url":"https://api.github.com/users/matart15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matart15/subscriptions","organizations_url":"https://api.github.com/users/matart15/orgs","repos_url":"https://api.github.com/users/matart15/repos","events_url":"https://api.github.com/users/matart15/events{/privacy}","received_events_url":"https://api.github.com/users/matart15/received_events","type":"User","site_admin":false},"created_at":"2016-10-17T03:18:09Z","updated_at":"2016-10-17T03:18:09Z","body":"I used this app to see copied libs.\r\nhttps://play.google.com/store/apps/details?id=com.xh.nativelibsmonitor.app&hl=en\r\n![screenshot_20161017-121132](https://cloud.githubusercontent.com/assets/17027219/19424334/38d59856-9463-11e6-8f50-2491416d2ea5.png)\r\n\r\nif this app working right then *.so files seems copied.\r\n\r\nIs it possible that *.so files are copied and not being referenced?"}}
{"actor":{"display_login":"matart15"}}