i am facing this issue while debugging it on emulator - flutter

problem was found with the configuration of task ':app:processDebugResources' (type 'LinkApplicationAndroidResourcesTask').
In plugin 'com.android.internal.version-check' type 'com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask' property 'androidJarInput.androidJar' specifies file 'C:\Users\NISHANT\AppData\Local\Android\sdk\platforms\android-31\android.jar' which doesn't exist.
Reason: An input file was expected to be present but it doesn't exist.

Solution 1: Try downloading android 31 from the Settings -> Appearance & Behavior -> System Settings -> Android SDK -> select SDK Platforms and check Android 12.0 and click apply and let it download and install and then try restarting Android studio and/or the laptop/PC if required and then try again.
Solution 2: If Solution 1 doesn't work out, try downloading and adding API 31 android.jar to the designated address: (C:\Users\NISHANT\AppData\Local\Android\sdk\platforms\android-31)

Related

Issue in setting up the Android emulator with React native

I am fairly new to React native and trying to set up Android environment with Visual studio. All the installation has been fairly successful, however, when I try to run the sample app on the android emulator executing the npx react-native run-android command it shows below error -
'C:\Users\Home' is not recognized as an internal or external command,
operable program or batch file.
error Failed to launch emulator. Reason: Could not start emulator within 30 seconds..
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
at org.codehaus.groovy.vmplugin.VMPluginFactory.<clinit>(VMPluginFactory.java:43)
at org.codehaus.groovy.reflection.GroovyClassValueFactory.<clinit>(GroovyClassValueFactory.java:35)
at org.codehaus.groovy.reflection.ClassInfo.<clinit>(ClassInfo.java:109)
However, when i execute adb devices on visual studio, it shows the list of emulator connected -
List of devices attached
emulator-5554 device
What could be the possible reason? Is this because my users name is Home PC? (Is this because there is a space in between) and it is not able to get the correct path?
This is because your java version is updated to the latest version and gradle is not supported with the installed version. what you can do is update the gradle as well
So go to gradle/wrapper folder inside the android folder
Edit gradle-wrapper.properties file and replace distributionUrl
with following value
https\://services.gradle.org/distributions/gradle-6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
I too faced the same issue.The problem is with the JDK. From JDK 14 i downgraded to JDK 11(LTS) version. And it worked.
Hope it helps.
Install Java 8 version, which is available Java 8 download
Gradle is not keeping up with the Java Latest versions, so roll back
to previous versions

No valid Android SDK platforms

When I write flutter doctor command in cmd I get this error.
No valid Android SDK platforms found in G:\SdkManager\platforms. Candidates were:
- android-21
- android-27
- android-28
- android-8.0.0
flutter doctor
env
path
flutter sdk
platforms
plugins
It appears as though this message shows up when you don't have any build-tools packages installed. At the time of writing, to install the minimum required versions, you can fix this issue with:
sdkmanager "platform-tools" "platforms;android-30" "build-tools;30.0.3"
I've set up my Android SDK manually on Windows 10 with the command line and I was able to solve this kind of errors while I tried to set up my development environment, if you want to solve it as I did, just follow the next steps that I posted in a GitHub Comment in a related issue:
https://github.com/flutter/flutter/issues/19805#issuecomment-478306166
You should download and install Android build tools for the respective platform versions. This can be done via the Android SDK Manager.
In AndroidStudio go to menu Tool > Android > SDK Manager
On the tab "SDK Platforms" select one or more platforms and click the OK button.
Wait until the download completed and try again.
Try to download all sdk from file-> settings -> sdkmanager.
And do not download manually.
Find your sdk path and execute the code.
$ flutter config --android-sdk <path-to-your-android-sdk-path>
see here
I think your path is incorrect in environment variable.
You should change it to G:/Sdkmanager/platforms

Ionic build faild:

When I build a new ionic app to android ,
Compilation failed .
The error is as follows:
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:3.0.0.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.0.0.
> Could not get resource 'https://maven.google.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
> Could not GET 'https://maven.google.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
> Remote host closed connection during handshake
Anyone can help me? I am confused.
OK, I know how to solve this problem.
First steps: Ansure have download jdk and set the 'java_home' and 'classpath';
Second steps: Ansure have download node, which verison is 1.8+;
Third steps : Downloading android studio , in this step will auto upset gradle and SDK;
After do above three steps, u can use android studio create a new blank android app an run simulator.
The last steps: set system enviroment variable 'SDK_HOME' and 'ANDROID_HOME' like this:
ANDROID_HOME E:\sdk (this is my computer setting)
SDK_HOME E:\sdk
path %SDK_HOME%\tools;%SDK_HOME%\platformtools;C:\Users\xxxxx\.gradle\wrapper\dists\gradle-4.1-all\bzyivzo6n839fup2jbap0tjew\gradle-3.1
EDIT:
Correction in folder name: platform-tools
%SDK_HOME%\tools;%SDK_HOME%\platform-tools;C:\Users\xxxxx\.gradle\wrapper\dists\gradle-4.1-all\bzyivzo6n839fup2jbap0tjew\gradle-3.1

Android studio:import NDK project from eclipse

I exported project from Eclipse(windows) and imported it to android studio V 0.4.2(ubuntu).
The project include working NDK library.
I get this error when try to run my app:
Execution failed for task ':app:compileDebugNdk'.
NDK not configured
From others stackoverflow posts, I understand that it is an issue.
But get no workaround for this.
Should i proceed the development with eclipse for now, or is that the a lazy option ?
EDIT :
I run this command:
export NDK=~/Downloads/android-ndk-r9c
and then :
and then go to my app directory and run this:
ndk-build
And i get this:
yarinkos-u#yarinkosu-MSI-Notebook-EX600:~/AndroidStudioProjects/AndEngineEXperimental$ ndk-build
/home/yarinkos-u/Downloads/android-ndk-r9c/ndk-build: 1: /home/yarinkos-u/Downloads/android-ndk-r9c/ndk-build: dirname: not found
/home/yarinkos-u/Downloads/android-ndk-r9c/ndk-build: 132: /home/yarinkos-u/Downloads/android-ndk-r9c/ndk-build: uname: not found
ERROR: Unknown host operating system:
What i did wrong?
It seems that the script running,but i miss something there.
EDIT 2:
i mistakenly runing this also :
export PATH=~/Downloads/android-ndk-r9c
so i get the error above.
If i running onlt this :
export NDK=~/Downloads/android-ndk-r9c
I get ndk-build not found error.
NDK Support is introduced from Android Studio 0.4.1 only, so make sure you are running AS 0.4.1 or above.
Android gradle plugin must be 0.7.+ in build.gradle file and also new NDK integration requires NDK r9c .
Lines from Developer tools blog under Release 0.4.1
Supports importing NDK projects. If the imported project contains NDK
sources, these are imported into the jni/ source set of the project,
the module name is inferred from the Makefile and stored in the Gradle
file, and the ndk.dir property is defined in local.properties.
Check more about it here :
http://tools.android.com/recent
you need to download the NDK for your operatings system # https://developer.android.com/tools/sdk/ndk/index.html once it's downloaded, install it it'll extract the contents to the correct file system it needs to be in it'll take some time, also make sure you are running the latest android studio. it worked for me. good luck.

invalid command line parameter when android execution

When I click the run as android application it shows the following error:
[2011-05-20 10:32:45 - Emulator] invalid command-line parameter: on.
[2011-05-20 10:32:45 - Emulator] Hint: use '#foo' to launch a virtual device named 'foo'.
[2011-05-20 10:32:45 - Emulator] please use -help for more information
This is most probably due to a space in the path. As Revision 12 is giving this error for everyone. Mine is Revision 12 in Eclipse Indigo Classic.
Please move your android-sdk folder to somewhere so that there doesn't contain any space in the path.
Or, try from command line.
Use below steps -
Right click Project -> Run As -> Run Configure -> Target
Scroll Down
Additional emulator command line option, type
-http-proxy http://10.1.1.10:8080
Restart ur emulator, it will work, and it is working for me too