Checking the license for package Android SDK Platform 31 in /Users/miaojiangwei/Library/Android/sdk/licenses License for package Android SDK Platform 31 accepted. Preparing "Install Android SDK Platform 31 (revision: 1)". "Install Android SDK Platform 31 (revision: 1)" ready. Installing Android SDK Platform 31 in /Users/miaojiangwei/Library/Android/sdk/platforms/android-31 "Install Android SDK Platform 31 (revision: 1)" complete. "Install Android SDK Platform 31 (revision: 1)" finished. Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 5260 bytes (99.7% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
FAILURE: Build failed with an exception.
* What went wrong: Execution failed for task ':app:bundleReleaseResources'. > A failure occurred while executing com.android.build.gradle.internal.res.Aapt2ProcessResourcesRunnable > Android resource linking failed /Users/miaojiangwei/工作/workspace/flutter/flutter_rent_house_demo/build/app/intermediates/bundle_manifest/release/AndroidManifest.xml:52: error: unexpected element <uses-permission> found in <manifest><application>. /Users/miaojiangwei/工作/workspace/flutter/flutter_rent_house_demo/build/app/intermediates/bundle_manifest/release/AndroidManifest.xml:54: error: unexpected element <uses-permission> found in <manifest><application>. /Users/miaojiangwei/工作/workspace/flutter/flutter_rent_house_demo/build/app/intermediates/bundle_manifest/release/AndroidManifest.xml:56: error: unexpected element <uses-permission> found in <manifest><application>.
* Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 42s Running Gradle task 'assembleRelease'... 102.7s Gradle task assembleRelease failed with exit code 1
<manifestxmlns:android="http://schemas.android.com/apk/res/android" package="com.example.rent_house"> <!-- 写入文件权限 --> <uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- 读取文件权限 --> <uses-permissionandroid:name="android.permission.READ_EXTERNAL_STORAGE" /> <!-- 相机权限 --> <uses-permissionandroid:name="android.permission.CAMERA" /> <application android:label="rent_house" android:name="${applicationName}" android:icon="@mipmap/ic_launcher"> <activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize"> <!-- Specifies an Android theme to apply to this Activity as soon as the Android process has started. This theme is visible to the user while the Flutter UI initializes. After that, this theme continues to determine the Window background behind the Flutter UI. --> <meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/NormalTheme" /> <intent-filter> <actionandroid:name="android.intent.action.MAIN"/> <categoryandroid:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <!-- Don't delete the meta-data below. This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> <!-- uses-permission 应该与 application 标签同级 --> <!-- 写入文件权限 --> <!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> --> <!-- 读取文件权限 --> <!-- <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> --> <!-- 相机权限 --> <!-- <uses-permission android:name="android.permission.CAMERA" /> --> <meta-data android:name="flutterEmbedding" android:value="2" /> </application> </manifest>
Build Error:uses-sdk:minSdkVersion 16
Error: uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:device_info_plus]
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 5844 bytes (99.6% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app. /Users/miaojiangwei/工作/workspace/flutter/flutter_rent_house_demo/android/app/src/main/AndroidManifest.xml Error: uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:device_info_plus] /Users/miaojiangwei/工作/workspace/flutter/flutter_rent_house_demo/build/device_info_plus/intermediates/merged_manifest/release/AndroidManifest.xml as the library might be using APIs not available in 16 Suggestion: use a compatible library with a minSdk of at most 16, or increase this project's minSdk version to at least 19, or use tools:overrideLibrary="dev.fluttercommunity.plus.device_info" to force usage (may lead to runtime failures) FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:processReleaseMainManifest'. > Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:device_info_plus] /Users/miaojiangwei/工作/workspace/flutter/flutter_rent_house_demo/build/device_info_plus/intermediates/merged_manifest/release/AndroidManifest.xml as the library might be using APIs not available in 16 Suggestion: use a compatible library with a minSdk of at most 16, or increase this project's minSdk version to at least 19, or use tools:overrideLibrary="dev.fluttercommunity.plus.device_info" to force usage (may lead to runtime failures)
* Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s Running Gradle task 'assembleRelease'... 3.3s
┌─ Flutter Fix ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ The plugin device_info_plus requires a higher Android SDK version. │ │ Fix this issue by adding the following to the file /Users/miaojiangwei/工作/workspace/flutter/flutter_rent_house_demo/android/app/build.gradle: │ │ android { │ │ defaultConfig { │ │ minSdkVersion 19 │ │ } │ │ } │ │ │ │ │ │ Following this change, your app will not be available to users running Android SDKs below 19. │ │ Consider searching for a version of this plugin that supports these lower versions of the Android SDK instead. │ │ For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration │ └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ Gradle task assembleRelease failed with exit code 1
处理
找到这个文件 /android/app/build.gradle
1 2 3 4 5 6 7 8 9 10
defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.rent_house" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName }
minSdkVersion 改为 19
1 2 3 4 5 6 7 8 9 10 11
defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.rent_house" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. // minSdkVersion flutter.minSdkVersion minSdkVersion 19 targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName }
flutter run app pods报错
从github上clone别人的项目,使用vscode试图去运行debug时诱发的一些问题!
1
error: could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig'in search paths (in target 'Runner')
➜ ios git:(master) ✗ rm -f Podfile ➜ ios git:(master) ✗ ls Flutter Runner Runner.xcworkspace Podfile.lock Runner.xcodeproj ➜ ios git:(master) ✗ ls Flutter Runner Runner.xcworkspace Podfile.lock Runner.xcodeproj ➜ ios git:(master) ✗ pod install [!] No `Podfile' found in the project directory. ➜ ios git:(master) ✗ pod init ➜ ios git:(master) ✗ ls Flutter Podfile.lock Runner.xcodeproj Podfile Runner Runner.xcworkspace ➜ ios git:(master) ✗ pod install Analyzing dependencies Downloading dependencies Generating Pods project Integrating client project Pod installation complete! There are 0 dependencies from the Podfile and 0 total pods installed. [!] The Podfile does not contain any dependencies. [!] Automatically assigning platform `iOS` with version `11.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`. [!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`). ➜ ios git:(master) ✗