Android Studio package debugging APK lacks .so library

platform

  • Ubuntu 16.04 x64
  • Android Studio 3.5.2
  • gradle-5.4.1
  • com.android.tools.build:gradle 3.5.1

Problem Description

Some of the previously developed test codes include the so library of JNI, and the storage directory is src/main/jniLibs . Before the update, whether it is a debug or release version of the application, the so library can be normally packaged into the apk file However,
after updating the version (studio and gradle were updated), it was found that during the debugging process, the application could not find the so library , and later found that the lib directory was missing in the packaged APK.

solution

gradle version rollback

  1. gradle/wrapper/gradle-wrapper.properties
#Mon Nov 18 16:32:18 CST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
  gradle-5.4.1 -> gradle-4.1
  1. build.gradle
   dependencies {
        classpath 'com.android.tools.build:gradle:3.5.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
  com.android.tools.build:gradle:3.5.1 -> com.android.tools.build:gradle:3.0.0

Expand

The google gradle plugin corresponds to the gradle version
Insert picture description here

Guess you like

Origin blog.csdn.net/ansondroider/article/details/103126651