Carpantas
Carpantas

Reputation: 131

Updated android studio and got fail with Gstreamer build

Updated to Android Studio 3.0.0 with new android gradle plugin. While buildin project got message:

What went wrong:
Execution failed for task `':app:externalNativeBuildDebug'`.

Expected output file at `gst-build-arm64-v8a/libgstreamer_android.so` for target `gstreamer_android` but there was none

but libgstreamer_android.so library file is already there. For native code I use ndk-build. Does anyone have this issue?

Upvotes: 5

Views: 2404

Answers (2)

Eduardo Fernando
Eduardo Fernando

Reputation: 629

UPDATE: Valery's answer works!

Obsolete answer:
That's not the perfect fix, it's just temporary until I have time to take a deep look into the problem.
Downgrade your gradle plugin:

  1. File -> Project Structure
  2. Click at "Project"
  3. At "Gradle version" field put:
    • 3.3
  4. At "Android Plugin Version" field put:
    • 2.3.3
  5. Hit "OK"

Accept the messages, sync the project, etc... Android Studio may prompt a windown asking for update gradle plugin again, just don't accept it for now...
I guess the update on gradle changed the way the builds are made, maybe something on Android.mk will have to change or some other parameter on build.grade...

edit: I found some clue at: https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html

API changes
Android plugin 3.0.0 introduces API changes that removes certain functionalities and may break your existing builds. Later versions of the plugin may introduce new public APIs that replace broken functionalities.

Modifying variant outputs at build time may not work Using the Variant API to manipulate variant outputs is broken with the new plugin. It still works for simple tasks, such as changing the APK name during build time, as shown below:...

So, I guess we should keep using the temporary fix (not updated version of gradle)...

Upvotes: 0

Carpantas
Carpantas

Reputation: 131

Add to build.gradle file of our android module field targets.

android { 
  defaultConfig { 
    externalNativeBuild { 
      ndkBuild { 
        targets "name_of_native_module_in_android_mk_file" 
      } 
  ... 
}

Don't add gstreamer_android.

Upvotes: 7

Related Questions