My android emulator run successfully, and before a project clone from github my flutter project worked fine. But when I clone a project after that show me a error, when I run my project, error like this:
Running Gradle task 'assembleDebug'...
Parameter format not correct -
D:\Flutter project\Practice\flutter_app_demo\android\app\src\debug\AndroidManifest.xml Error:
uses-sdk:minSdkVersion 16 cannot be smaller than version 23 declared in library [:audioplayers] D:\Flutter project\Practice\flutter_app_demo\build\audioplayers\intermediates\library_manifest\debug\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 23,
or use tools:overrideLibrary="xyz.luan.audioplayers" to force usage (may lead to runtime failures)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 23 declared in library [:audioplayers] D:\Flutter project\Practice\flutter_app_demo\build\audioplayers\intermediates\library_manifest\debug\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 23,
or use tools:overrideLibrary="xyz.luan.audioplayers" 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 45s
Exception: Gradle task assembleDebug failed with exit code 1
I don't know why show error like this.
Any suggestion Please.
its seems you have an error in your AndroidManifest.xml if you making any change in this file you should check it or put this file here to taking look at it
Related
I have a task to build apk applications with react native, I watched this video to understand how to do it and took the same code
https://www.youtube.com/watch?v=5tgcogEoIiQ&t=590s
https://github.com/mahdi-sharifimehr/RN-Tutorial-Main/tree/RN-Tutorial-35
I got such an error:
> Task :app:processDebugManifest FAILED
Type 'ProcessApplicationManifest': static method 'getArtifactName()' should not be annotated with: #Internal. This behaviour has been deprecated and is scheduled to be removed in Gradle 7.0. See https://docs.gradle.org/6.2/userguide/more_about_tasks.html#sec:up_to_date_checks for more details.
Type 'ProcessApplicationManifest': static method 'getNameFromAutoNamespacedManifest()' should not be annotated with: #Internal. This behaviour has been deprecated and is scheduled to be removed in Gradle 7.0. See https://docs.gradle.org/6.2/userguide/more_about_tasks.html#sec:up_to_date_checks for more details.
/root/escrow_checker/apps/RN-Tutorial-Main-RN-Tutorial-35/android/app/src/debug/AndroidManifest.xml Error:
uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [com.facebook.react:react-native:0.71.0-rc.0] /root/.gradle/caches/transforms-2/files-2.1/af47c244ab2af63c65c98f6eb4516ef2/jetified-react-native-0.71.0-rc.0-debug/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 21,
or use tools:overrideLibrary="com.facebook.react" to force usage (may lead to runtime failures)
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [com.facebook.react:react-native:0.71.0-rc.0] /root/.gradle/caches/transforms-2/files-2.1/af47c244ab2af63c65c98f6eb4516ef2/jetified-react-native-0.71.0-rc.0-debug/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 21,
or use tools:overrideLibrary="com.facebook.react" 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 19s
found a solution on the Internet and changed minSdkVersion in build.gradle to 23, but now I get such an error:
> Task :app:processDebugResources FAILED
Type 'LinkApplicationAndroidResourcesTask': non-property method 'canHaveSplits()' should not be annotated with: #Input. This behaviour has been deprecated and is scheduled to be removed in Gradle 7.0. See https://docs.gradle.org/6.2/userguide/more_about_tasks.html#sec:up_to_date_checks for more details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
/root/.gradle/caches/transforms-2/files-2.1/991cf6dc746cd39d23cce3c15a61bfa7/core-1.7.0/res/values/values.xml:105:5-114:25: AAPT: error: resource android:attr/lStar not found.
please tell me what's wrong and why I can't easily build the apk, here are my actions
in main directory
npm install
cd android
chmod +x ./gradlew
./gradlew assembleDebug
Gradle version Gradle 7.4.2
I don’t understand why it doesn’t want to build, in theory I should have got apk
" uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library "
Looks like your minSdkVersion isn't compatible with your facebook library you're using. What kind of React Native project are you using?
If it's expo managed you'll need this: https://docs.expo.dev/versions/latest/sdk/build-properties/
If it's a non-expo project, you can easily go into the Android files on your own. This link will help you: How to specify the minSdkVersion in react native project
It's likely that you just need to change the 16 to a 21 and it'll build.
I am developing a bluetooth app using flutter in android studio. I am getting the following error:
The plugin flutter_blue uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
Launching lib\main.dart on SM G885F in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Apps\Bluetooth\android\app\build.gradle' line: 51
What went wrong:
Could not compile build file 'C:\Apps\Bluetooth\android\app\build.gradle'.
startup failed:
build file 'C:\Apps\Bluetooth\android\app\build.gradle': 51: Statement labels may not be used in build scripts.
In case you tried to configure a property named 'minSdkVersion', replace ':' with '=' or ' ', otherwise it will not have the desired effect.
# line 51, column 24.
minSdkVersion: 19
^
1 error
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 1s
Exception: Gradle task assembleDebug failed with exit code 1
in my case, i solved it by changing the minSDK 19 to 29, just update the number from 19 to 29 and try build your app.
I'm trying to build my Apache Cordova app for android and I face with this error. I found that android:exported="true" must be added to the activity attributes but since I am using many cordova-plugins which add different activity attribute to the AndroidManifest.xml it is impossible to change all of them manually.
I want to know does anyone have any solution for this problem?
Note: For using new plugins I cannot downgrade my sdk target version to 30 an I must use 31.
Error code:
[17:39:47] FAILURE: Build failed with an exception.
[17:39:47] * What went wrong:
[17:39:47] Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
[17:39:47] Execution failed for task ':app:processReleaseMainManifest'.
[17:39:47] > Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
[17:39:47] * Try:
[17:39:47] 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.
[17:39:47] * Get more help at https://help.gradle.org
[17:39:47] You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
[17:39:47] See https://docs.gradle.org/7.1.1/userguide/command_line_interface.html#sec:command_line_warnings
[17:39:47] 14 actionable tasks: 14 executed
[17:39:47] BUILD FAILED in 1m 34s
[17:39:47] Command failed with exit code 1: /tmp/download/platforms/android/gradlew :app:bundleRelease -b /tmp/download/platforms/android/build.gradle
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\romit\Desktop\FlutterSoft\projects\basic_app\android\build.gradle' line: 26
What went wrong:
A problem occurred evaluating root project 'android'.
A problem occurred configuring project ':app'.
Could not open proj generic class cache for build file 'C:\Users\romit\Desktop\FlutterSoft\projects\basic_app\android\app\build.gradle' (C:\Users\romit.gradle\caches\6.7.1\scripts\4hhqko2lgng4etjv4i11vmj58).
> BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 60
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 1s
Exception: Gradle task assembleDebug failed with exit code 1
NOTE: I have already updated the gradle. Also tried solving it by using gradlew clean and gradlew build.
DOES ANYONE HAVE SOLUTION FOR THIS?
///build.gradle snippets
Code LINE -1-27
Remaining Lines
Major Version 60 is for Java 16 - see https://en.wikipedia.org/wiki/Java_class_file#General_layout.
As far as I know Android does not support this java version at all. Also it seems Android Studio does only support Java 7 (full) and Java 8 (partial) - see https://developer.android.com/studio/write/java8-support.
Android Gradle plugin 3.0.0 and later support all Java 7 language
features and a subset of Java 8 language features that vary by
platform version. When building your app using Android Gradle plugin
4.0.0 and higher, you can use a number of Java 8 language APIs without requiring a minimum API level for your app.
I am using Eclipse most time, but I think the settings can be done as described at
https://developer.android.com/studio/intro/studio-config#jdk
We are trying to build an apk package for a new version on android store.
We got the following error :
FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:processReleaseManifest'. > Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:CordovaLib] /usr/src/app/platforms/android/CordovaLib/build/intermediates/manifests/full/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="org.apache.cordova" 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. * Get more help at https://help.gradle.org BUILD FAILED in 1m 52s 23 actionable tasks: 23 executed (node:1) UnhandledPromiseRejectionWarning: Error: /usr/src/app/platforms/android/gradlew: Command failed with exit code 1 Error output: Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/src/app/platforms/android/app/src/main/AndroidManifest.xml:37:5-74 Error: uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:CordovaLib] /usr/src/app/platforms/android/CordovaLib/build/intermediates/manifests/full/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="org.apache.cordova" to force usage (may lead to runtime failures) FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:processReleaseManifest'. > Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:CordovaLib] /usr/src/app/platforms/android/CordovaLib/build/intermediates/manifests/full/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="org.apache.cordova" 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. * Get more help at https://help.gradle.org BUILD FAILED in 1m 52s at ChildProcess.whenDone (/usr/src/app/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23) at emitTwo (events.js:126:13) at ChildProcess.emit (events.js:214:7) at maybeClose (internal/child_process.js:925:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) (node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
We have no clue why and tried to debug it with the ionic dashboard unsuccessfuly.
Thank you
Increase your android-minSdkVersion to 19 inside your config.xml of your ionic project.
<preference name="android-minSdkVersion" value="19" />