Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
372 views
in Technique[技术] by (71.8m points)

Flutter apk doesn't work in android device

I try to generate apk file for my flutter app, I used flutter build apk --release command after flutter clean command. note that after used flutter build apk --release command I got this error:

Note: C:srcflutter.pub-cachehostedpub.dartlang.organdroid_intent-0.3.7+3androidsrcmainjavaioflutterpluginsandroidintentMethodCallHandlerImpl.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: C:srcflutter.pub-cachehostedpub.dartlang.orgurl_launcher-5.4.5androidsrcmainjavaioflutterpluginsurllauncherWebViewActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

After that, I got the apk file from this path: C:project_pathuildappoutputsapk elease, but when I try to install this apk from the mobile I got this app not installed:

enter image description here

note: I'm tried more than one device with a different android version.

Please help me to solve my problem.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Seems to be warnings, not errors, thus the apk should be generated.

In any case, did you check the hardware architecture?

For example, try to specify the architecture for your smartphone:

flutter build apk --target-platform android-arm64

flutter build apk --target-platform android-arm ( <-- arm 32 bits)

etc...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.8k users

...