Skip to content

Support APKs with 32-bit and 64-bit binaries within them #18494

Closed
@peace2knowledge

Description

@peace2knowledge

using flutter build apk --release --flavor pro make apk file , but arm64-v8a do not include libflutter.so file.so app launch fail.
when I add --target-platform=android-arm64 : flutter build apk --release --flavor pro --target-platform=android-arm64,apk file include so flie. But app launch fail on 32 bit cpu.
what can i do, apk file can run on 64 and 32 cpu @mravn-google

/System.err(15263): java.lang.UnsatisfiedLinkError: Couldn't load flutter from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.jianzhibao.ka.enterprise-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.jianzhibao.ka.enterprise-1, /vendor/lib, /system/lib]]]: findLibrary returned null

I create new project, debug or releas, work well. diffrece from new project from my project is that i add thrid party so file

image

where is the problem ?

Activity

swavkulinski

swavkulinski commented on Jun 21, 2018

@swavkulinski

AFAIK, currently, Flutter will only add libflutter.so to one selected platform folder in the release APK. The workaround which worked for me was to force build.gradle to do 32bit only (excluding all 64bit libraries + Intel)

release {
        
    ...
            ndk{
                abiFilters "armeabi-v7a"
            }
}
zoechi

zoechi commented on Jun 22, 2018

@zoechi
Contributor
jeanpaulcozzatti

jeanpaulcozzatti commented on Jul 1, 2018

@jeanpaulcozzatti

@swavkulinski how would you release the to apks to the playstore?

kevinvandenbreemen

kevinvandenbreemen commented on Jul 24, 2018

@kevinvandenbreemen

Similar to #18939

qbsho

qbsho commented on Jul 26, 2018

@qbsho

Have the same problem - but flutter.so not included in "armeabi-v7a folder.
Has only third party libraries for x86 and armeabi-v7a - but no arm64.
Would like to build flutter only for "armeabi-v7a with
ndk{
abiFilters "armeabi-v7a" // also not work"armeabi", "x86",
}
and set as target-platform as @mravn-google suggest to android-arm.

APK without specify arch and not include libraries
screen shot 2018-07-26 at 21 06 53

APK with libraries and no arm spec
screen shot 2018-07-26 at 21 10 30

APK with specify arch and include libraries
screen shot 2018-07-26 at 21 12 58

Any suggestion how to debug further steps?

peasfarmer

peasfarmer commented on Aug 9, 2018

@peasfarmer
gurleensethi

gurleensethi commented on Aug 13, 2018

@gurleensethi

I have the same problem, building for 32-bit will exclude 64-bit devices, it runs on them though. Building for 64 by specifying --target-platform android-arm64 works on 64-bit devices, but crashes on 32-bit devices. Also Google will be restricting upload of apks to be 64-bit in 2019.

Flutter Team, please resolve this basic issue!

dieegov

dieegov commented on Aug 14, 2018

@dieegov
added
toolAffects the "flutter" command-line tool. See also t: labels.
t: gradle"flutter build" and "flutter run" on Android
on Aug 15, 2018
bdytx5

bdytx5 commented on Aug 30, 2018

@bdytx5

So am I wrong by saying that flutter can only support release apk’s for either 32 or 64 bit, but not both?

jeanpaulcozzatti

jeanpaulcozzatti commented on Sep 13, 2018

@jeanpaulcozzatti
bdytx5

bdytx5 commented on Sep 14, 2018

@bdytx5

332 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

c: new featureNothing broken; request for a new capabilitycustomer: crowdAffects or could affect many people, though not necessarily a specific customer.platform-androidAndroid applications specificallyt: gradle"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.waiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @mattetti@jbg@trevorwang@jeanpaulcozzatti@Ricket

      Issue actions

        Support APKs with 32-bit and 64-bit binaries within them · Issue #18494 · flutter/flutter