应用程序在调试模式下运行流畅,但在发布时无法打开应用程序 apk 颤振



我在manifeest中使用了权限,但无法使用

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

我还使用了flutter构建apk——释放——没有收缩不起作用,我还使用flutter clean没有wokred,我将等级4.1.0改为3.5.0不起作用。我将分配graldle 6.7all改为6.5.1all不起作用

我使用的包裹

http:
sqfentity:
flutter_riverpod:
shared_preferences: ^2.0.6

我用了

import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'pages/signup_page.dart';
void main() {
runApp(ProviderScope(child: MyApp()));
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Container(),
);
}
}

我添加了multiDexEnabled、shrinkResources和minimyEnabled并解决了

android {
compileSdkVersion 30
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.assignmenet"
minSdkVersion 16
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
ndkVersion "22.1.7171670"
multiDexEnabled true
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
shrinkResources false
minifyEnabled false
}
}
}

相关内容

最新更新