When I run Flutter build apk command the terminal gives me a warning. But apk file generated successfully. Do you have any idea to how to solve this warning?
Here is my terminal output:
Building with sound null safety
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01Running Gradle task 'assembleRelease'... 103.1s
√ Built build\app\outputs\flutter-apk\app-release.apk (16.3MB).
Just update the Android Gradle Plugin version from 4.1.0 to 7.0.2 using new android
Related
I'm trying to export my quasar app for Android via cordova:
I ran into several issues an error which get to fix step by step. (Lots of mismatching Java and Android Versions.
Now I get this error with Gradle which I can't read anymore.
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=/Users/jannofleischer/Library/Android/sdk (recommended setting)
ANDROID_HOME=/Users/jannofleischer/Library/Android/sdk (DEPRECATED)
Using Android SDK: /Users/jannofleischer/Library/Android/sdk
Subproject Path: CordovaLib
Subproject Path: app
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: unerwartetes Element (URI:"", lokal:"base-extension"). Erwartete Elemente sind <{}codename>,<{}layoutlib>,<{}api-level>
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 572ms
48 actionable tasks: 48 up-to-date
Built the following apk(s):
/Users/jannofleischer/rubbellose/src-cordova/platforms/android/app/build/outputs/apk/debug/app-debug.apk
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=/Users/jannofleischer/Library/Android/sdk (recommended setting)
ANDROID_HOME=/Users/jannofleischer/Library/Android/sdk (DEPRECATED)
Using Android SDK: /Users/jannofleischer/Library/Android/sdk
Command failed with exit code 1: apkanalyzer manifest target-sdk /Users/jannofleischer/rubbellose/src-cordova/platforms/android/app/build/outputs/apk/debug/app-debug.apk
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.tools.apk.analyzer.ApkAnalyzerCli.getAaptInvokerFromSdk(ApkAnalyzerCli.java:277)
at com.android.tools.apk.analyzer.ApkAnalyzerCli.main(ApkAnalyzerCli.java:129)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 5 more
App • Command "cordova" failed with exit code: 1
App • Updated Cordova config.xml
App • ⚠️ FAIL Cordova CLI has failed
Anyone has a hint what's causing this error or how I can make use of the --warning-mode all option?
Operating System is MacOS by the way (M1 ARM Chip, if that matters)
i have same problem and finally fixed for me. u can change version of the Gradle and JDK from project structure (using Android Studio / File Menu) this tutorial can be help.
So for resolve the problem u can use this tutorial, note that Gradle version must be compatible with jdk version.
Links
Gradle Release Notes:
https://docs.gradle.org/7.3/release-notes.html
Java and Gradle Compatibility Matrix: docs.gradle.org/current/userguide/compatibility.html#java
Compatibility Example
Java (JDK): jdk-18.0.2.1
Gradle: 7.5
Embedded Kotlin version: 1.6.21
Kotlin Language version: 1.4
Enviroments
Windows:
setx ANDROID_HOME "%USERPROFILE%\AppData\Local\Android\Sdk"
setx ANDROID_SDK_ROOT "%USERPROFILE%\AppData\Local\Android\Sdk"
setx JAVA_HOME "C:\Program Files\Java\jdk-18.0.2.1"
setx path "%path%;%ANDROID_SDK_ROOT%\tools;%ANDROID_SDK_ROOT%\platform-tools;"
Unix (macOS, linux):
export ANDROID_HOME="$HOME/Android/Sdk"
export ANDROID_SDK_ROOT="$HOME/Android/Sdk"
export JAVA_HOME="{{path to java}}/jdk-18.0.2.1"
export PATH=$PATH:$ANDROID_SDK_ROOT/tools;
PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
cordova requirements
Requirements check results for android:
Java JDK: installed 18.0.2
Android SDK: installed true
Android target: installed android-32,android-31,android-30,android-29,android-28,android-27,android-26,android-25,android-24,Google Inc.:Google APIs:24,android-17,android-15,android-7
Gradle: installed C:\Users#myuserprofile#\AppData\Local\Android\Sdk\gradle-7.5\bin\gradle.BAT
After Build (Result):
BUILD SUCCESSFUL in 19s
52 actionable tasks: 52 executed
I'm trying to compile a new project on cmd using cocos2d-x v3.10, but the build is failing and I'm getting the following error:
The output as seen on cmd.
-pre-compile:
-compile:
[javac] Compiling 29 source files to D:\Varun\MyApp\MyApp\cocos2d\cocos\platform
\android\java\bin\classes
[javac] error: error reading D:\Varun\MyApp\MyApp\cocos2d\cocos\platform\android
\java\libs\._android-async-http-1.4.8.jar; error in opening zip file
[javac] warning: [options] source value 1.5 is obsolete and will be removed
in a future release
[javac] warning: [options] target value 1.5 is obsolete and will be removed
in a future release
[javac] warning: [options] To suppress warnings about obsolete options, use
-Xlint:-options.
[javac] 1 error
[javac] 3 warnings
BUILD FAILED
D:\adt-bundle-windows-x86_64-20140321\sdk\tools\ant\build.xml:601: The following
error occurred while executing this line:
D:\adt-bundle-windows-x86_64-20140321\sdk\tools\ant\build.xml:720: The following
error occurred while executing this line:
D:\adt-bundle-windows-x86_64-20140321\sdk\tools\ant\build.xml:734: Compile faile
d; see the compiler error output for details.
Total time: 2 seconds
Error running command, return code: 1.
I'm using the following:
JDK: 1.8.0_73
Android api: 19
NDK: r9
Ant: 1.9.6
Python: 2.7.11
I think ._android-async-http-1.4.8.jar is a hidden file or the file is corrupted.
For case one, just rename it to android-async-http-1.4.8.jar and refer it to again.
For case two, just download a new one.
My app was working with out any issue. But today when I try to build my app for android I am getting this error.
ENOENT: no such file or directory, scandir C\Users\MyUser\MyTest\bld\Debug\platforms\android\src\com\Test\mytest
I tried to clear the cordova cache and tryed and got this error.
1>------ Rebuild All started: Project: MyTest, Configuration: Debug Android ------
1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\Microsoft.TypeScript.targets(95,5): warning : The TypeScript Compiler was given no files for compilation, so it will skip compiling.
1> GeneratedJavascript=
1> C:\Users\MyUser\Desktop\MyTest>call "C:\Program Files\nodejs"\nodevars.bat
1> Your environment has been set up for using Node.js 4.2.1 (x64) and npm.
1> ------ Ensuring correct global installation of package from source package directory: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\COMMON7\IDE\EXTENSIONS\3RZ4IYYB.KXY\packages\vs-mda
1> ------ Name from source package.json: vs-mda
1> ------ Version from source package.json: 0.1.75
1> ------ Package not currently installed globally.
1> ------ Installing globally from source package. This could take a few minutes...
1> npm WARN deprecated graceful-fs#3.0.8: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs#^4.0.0 as soon as possible.
1> npm WARN deprecated npmconf#0.1.16: this package has been reintegrated into npm and is now out of date with respect to npm
1> npm WARN engine npm#1.3.4: wanted: {"node":">=0.6","npm":"1"} (current: {"node":"4.2.1","npm":"2.14.7"})
1> npm WARN engine cordova-js#3.7.2: wanted: {"node":"~0.10.x"} (current: {"node":"4.2.1","npm":"2.14.7"})
1> npm WARN engine npm#1.3.4: wanted: {"node":">=0.6","npm":"1"} (current: {"node":"4.2.1","npm":"2.14.7"})
1> npm WARN engine xmlbuilder#2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"4.2.1","npm":"2.14.7"})
1> npm WARN deprecated lodash-node#2.4.1: This package has been discontinued in favor of lodash#^4.0.0.
1> npm WARN engine cordova-js#3.6.2: wanted: {"node":"~0.10.x"} (current: {"node":"4.2.1","npm":"2.14.7"})
1> npm WARN installMany normalize-package-data was bundled with npm#1.3.4, but bundled package wasn't found in unpacked tree
1> npm WARN installMany normalize-package-data was bundled with npm#1.3.4, but bundled package wasn't found in unpacked tree
1> C:\Users\MyUser\AppData\Roaming\npm\vs-cli -> C:\Users\MyUser\AppData\Roaming\npm\node_modules\vs-mda\vs-cli.cmd
1> vs-mda#0.1.75 C:\Users\MyUser\AppData\Roaming\npm\node_modules\vs-mda
1> ├── q#1.0.1
1> ├── rimraf#2.2.6
1> ├── ncp#0.5.1
1> ├── mkdirp#0.3.5
1> ├── adm-zip#0.4.4
1> ├── fstream#0.1.28 (inherits#2.0.1, graceful-fs#3.0.8)
1> ├── tar#0.1.20 (inherits#2.0.1, block-stream#0.0.8)
1> ├── optimist#0.6.1 (wordwrap#0.0.3, minimist#0.0.10)
1> ├── elementtree#0.1.6 (sax#0.3.5)
1> ├── request#2.36.0 (aws-sign2#0.5.0, forever-agent#0.5.2, tunnel-agent#0.4.2, qs#0.6.6, oauth-sign#0.3.0, mime#1.2.11, json-stringify-safe#5.0.1, tough-cookie#2.2.1, node-uuid#1.4.7, http-signature#0.10.1, hawk#1.0.0, form-data#0.1.4)
1> ├── ripple-emulator#0.9.24 (connect-xcors#0.5.2, colors#0.6.0-1, open#0.0.3, accounting#0.4.1, moment#1.7.2, request#2.12.0, express#3.1.0)
1> ├── plugman#0.22.4 (q#0.9.7, underscore#1.4.4, nopt#1.0.10, rc#0.3.0, npm#1.3.4, cordova-lib#0.21.6)
1> └── cordova#4.1.2 (underscore#1.7.0, nopt#3.0.1, cordova-lib#4.1.2)
1> ------ npm install of vs-mda#0.1.75 from C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\COMMON7\IDE\EXTENSIONS\3RZ4IYYB.KXY\packages\vs-mda completed.
1>MDAVSCLI : error : ENOENT: no such file or directory, scandir 'C:\Users\MyUser\Desktop\Test\MyTest\bld\Debug\platforms\android\src\com\Test\mytest'
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
I have no idea. Couple of days ago it was working perfectly. Can anyone help me.
Thanks.
In your visual studio cordova project check whether your id have the android signature in config.xml. If not rename the id and rebuild the project.
id = mytestapp.test - wrong
id=com.mytestapp.test -correct
Hi did you checked 'C:\Users\MyUser\Desktop\Test\MyTest\bld\Debug\platforms\android\src\com\Test\mytest' folder ? Try to access here , check the rights of your user.
I'm trying to build android app using Crosswalk. I followed this official guideto set up.
And succeed in building example project. But after when I try to build from my own HTML5 project, it builds failed.
ERROR Outputs:
Starting application build (arm)
* Checking keystore for signing
No keystore provided for signing. Using xwalk's keystore for debugging.
Please use a valid keystore when distributing to the app market.
* Updating project with xwalk_core_library
* Checking for external extensions
* Copying native libraries for arm
* Building Android apk package with Crosswalk embedded (arm)
[javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[javac] 3 warnings
[javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[javac] 3 warnings
BUILD FAILED
/home/jian/app/android-sdk-linux/tools/ant/build.xml:928: The following error occurred while executing this line:
/home/jian/app/android-sdk-linux/tools/ant/build.xml:946: null returned: 1
Total time: 40 seconds
Command "/home/jian/app/ant/bin/ant release -f /tmp/Threecakes-Qqo589/build.xml -Dkey.store=/home/jian/app/crosswalk-14.43.343.17/xwalk-debug.keystore -Dkey.alias=xwalkdebugkey -Dkey.store.password=xwalkdebug -Dkey.alias.password=xwalkdebug" exited with non-zero exit code 1
This is my environment setting:
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export ANDROID_HOME=/home/jian/app/android-sdk-linux
export ANT_HOME=/home/jian/app/ant
export PATH=/home/jian/app/ant/bin:/usr/lib/jvm/java-8-oracle/bin:$PATH
export PATH=/home/jian/app/android-sdk-linux:$PATH
export PATH=/home/jian/app/android-sdk-linux/tools:$PATH
export PATH=/home/jian/app/android-sdk-linux/platform-tools:$PATH
This is version information:
java -version
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)
ant -version
Apache Ant(TM) version 1.9.6 compiled on June 29 2015
adb help
Android Debug Bridge version 1.0.32
crosswalk version
14.43.343.17
And This is part of ant/build.xml where the error occured.
<target name="-package-resources" depends="-crunch">
<!-- only package resources if *not* a library project -->
<do-only-if-not-library elseText="Library project: do not package resources..." >
<aapt executable="${aapt}"
command="package"
versioncode="${version.code}"
versionname="${version.name}"
debug="${build.is.packaging.debug}"
manifest="${out.manifest.abs.file}"
assets="${asset.absolute.dir}"
androidjar="${project.target.android.jar}"
apkfolder="${out.absolute.dir}"
nocrunch="${build.packaging.nocrunch}"
resourcefilename="${resource.package.file.name}"
resourcefilter="${aapt.resource.filter}"
libraryResFolderPathRefid="project.library.res.folder.path"
libraryPackagesRefid="project.library.packages"
libraryRFileRefid="project.library.bin.r.file.path"
previousBuildType="${build.last.target}"
buildType="${build.target}"
ignoreAssets="${aapt.ignore.assets}">
<res path="${out.res.absolute.dir}" />
<res path="${resource.absolute.dir}" />
<!-- <nocompress /> forces no compression on any files in assets or res/raw -->
<!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets and res/raw -->
</aapt>
</do-only-if-not-library>
</target>
Why I succeed in building example project but failed to building my own project? And how do I fix this error. Thank you for your help!
I had the same problem.
I downgrade version of Java to fix it :
java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
You can report your issue to https://crosswalk-project.org/jira/browse/ to get faster response from Crosswalk developer.
Hi World App is running in simulator but not generating the BUILD files.
I am getting this error
goBlank:
testFail:
setupJavac:
jar:
[echo] Compile is forcing compliance to the supported API's/features for maximum device compatibility. This allows smaller
[echo] code size and wider device support
[copy] Copying 1 file to E:\rainforest\rfl1\rfl1-1\testcodenameone\build\tmp
[javac] E:\rainforest\rfl1\rfl1-1\testcodenameone\build.xml:131: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 3 source files to E:\rainforest\rfl1\rfl1-1\testcodenameone\build\tmp
[jar] Building jar: E:\rainforest\rfl1\rfl1-1\testcodenameone\dist\testcodenameone.jar
[javac] E:\rainforest\rfl1\rfl1-1\testcodenameone\build.xml:155: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
BUILD FAILED
E:\rainforest\rfl1\rfl1-1\testcodenameone\build.xml:155: Class not found: javac1.8
Total time: 3 seconds
You need Eclipse itself to run under JDK 1.7 (this needs to be configured via the Eclipse ini file). Also make sure JAVA_HOME points to JDK 1.7.