what is the way to install the basic4android - basic4android

I installed the jre7 and jdk1.7 and android sdk and avd manager perfectly my emulator is working properly but when i run the program which i wrote it is showing
Compiling code. 0.11
Compiling layouts code. 0.02
Generating R file. 0.00
Compiling generated Java code. Error
javac 1.7.0_17
javac: file not found: src\com\empire\designerscripts\*.java
Usage: javac <options> <source files>
use -help for a list of possible options
i newly formatted my system installed these
I am using basic4android in my laptop without any problem but in case of my desktop system it is showing the above error...

I have understood from Erel that this is fixed with Basic4Android v2.50 or above. One can also instead install the latest Java 6 version and use it for compilation.
The use of Java 6 was successful in my case.

I think that the problem is with the jdk that you are running. Try with jdk1.6.0_25. I use this one and never update this version because the version 7 have some issues with security.

Related

Could not open settings generic class cache for settings file '

I reinstalled my android studio since the sdk was not found and so on. After re installing java jdk and android studio , everything worked well until I got an error saying 'Could not initialize class org.codehaus.groovy.runtime.InvokerHelper' which I solved by changing the Gradle version. And now the error is 'Type 'FlutterTask' property 'assets' is missing an input or output annotation.'
FAILURE: Build failed with an exception.
What went wrong:
Could not open settings generic class cache for settings file 'C:\Users\loran\ASProjects\xylophone-flutter\android\settings.gradle' (C:\Users\loran.gradle\caches\6.8.2\scripts\4mawlyb2l5e9tefyvnpxva1kg).
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 46s
Exception: Gradle task assembleDebug failed with exit code 1
I also had this problem So I did install java 8
You might have Java 13 So install Java 8
Java JDK 16 is the one that seems to lead to this issue try downgrading by downloading a lower version of JDK preferable JDK 8 or 11
To future individuals who will run to this error. Here is the link to download the JDK enjoy your coding experience don't forget to change the path too.
https://www.oracle.com/java/technologies/javase-downloads.html
mainly you have jdk16 i tried to install java 8 and set env to java 8 it worked for me
Try installing the latest Gradle package gradle-7.1.1, if you are using Java JDK 16 installed. To do this open android/gradle/wrapper/gradle-wrapper.properties file and under distribution url, update the gradle version to 7.1.1 (or the latest). After that, inside your Flutter project directory, run the following command in the terminal:
cd android && ./gradlew
I removed the JAVA_HOME path to the JAVA download and changed JAVA_HOME path to the following:
C:\Program Files\Android\Android Studio\jre
I am now coding
FOUND IT !
No need to change your JDK version, follow the steps to resolve the issue:
check your java version and remember it, use "java -version" in terminal
go to your android studio path installation
then in: Android Studio/jre/ open the file named "release"
take attention of the value of JAVA_VERSION field
if it's not the same as the java version on your computer, just change it with the version installed on your computer.
That's it, i hope it will resolve your issue like it resolves mine.
Try it and give a feedback.
Try this!
Remove package android from the top of settings.gradle. This helped me out.
If this error occurs, this might because you have installed the latest JDK such as JDK 16. You download and install JDK 8 and uninstall JDK 16. Then restart the desktop/laptop and try launch and run flutter run again. It should be working fine.
In my case, on Windows 10, my JAVA_HOME was set to JAVA SE 16 C:\Program Files\Java\jdk-16 and when I looked at the release file in java jre in android studio, C:\Program Files\Android\Android Studio\jre\release, I found that the the JAVA_VERSION WAS "11.0.10" (java 11) for short. So I changed the java installation on my PC to Java 11, update JAVA_HOME in my environment variables to point to the new java (C:\Program Files\Java\jdk-11.0.12) and restarted android studio, Then everything worked.
You can get your java 11 from here.
https://www.oracle.com/java/technologies/javase-jdk11-downloads.html. Change 11 to 8, 16 etc to get the download link for the java version you need.
The problem has to do with having Java 13 or 16 installed on your computer. The current version of Flutter does not work with Java 13 and 16. Just uninstall either of these that you may have installed and installed Java 8 or Java 11. Restart your computer to effect the update. Everything should be fine afterwards
I got this error when using flutter. I fixed it ensuring the android-studio-dir path was set correctly.
You set it up using flutter config --android-studio-dir="android studio path".
Then run flutter doctor and ensure flutter can see Android Studio
In 'adnroid/gradle/wrapper/gradle-wrapper.properties'
Change distributionUrl to version 7.0.1
In 'android/build.gradle'
Change 'com.android.tools.build:gradle' to version 4.2.0
Java 11 is the only supported version by Flutter as for now. It compiles and installs.
Previously I had this error using Java 19 and Java 8.
You might want update your gradle version.
Check the supported gradle <-> kotlin <-> java version on their page.
You can try this, it works for me.
Open the android module to a new window and automatically download all necessary libraries after successfully building finished run the app.
Simply go to your Android Studio path -> C:\Program Files\Android\Android Studio
open jbr folder -> copy all files -> then go back -> paste all the files in the jre folder and "replace the files in the destination".
It works for me in two different laptops. I have latest jdk version - 19.0.2
The error message you're seeing is related to the flutter build process and it occurs when a required input or output annotation is missing from the assets property of the FlutterTask.
task buildFlutter(type: FlutterTask) {
// Add the #Input annotation to the assets property
#Input List<String> assets = ["assets/images/", "assets/fonts/"]
}
Try to disable AVAST, check system vatiables path for JDK and SDK, clear cache with yarn.

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

Error when open eclipse - MAC

I have installed eclipse on my iMac and when I try to open it, it gives me this error:
Failed to find a Main Class in
"/Applications/Eclipse.app/Contents/MacOS//../Eclipse/ plugins/org.eclipse.equinox.launcher_1.5.0.v20180512-1130.jar".
On my MacBook Pro, everything works fine, but I have done nothing different.
I have checked other posts, but most of them refer to a windows OS. There was an answer which said that it can just open when everything is in an English folder and this is true for me!
Thanking you in advance!
I came across this error after installing Eclipse PDT.
Open your terminal and run the version command: java -version.
If your java version is below 1.8, you will have to update your Java
Runtime Environment to at least 1.8.0 by installing an updated JDK
here.
Then re-run the java version command and your version
should be updated.
You should now be able to install and run
Eclipse.
I have the same issue, but on my MacBookPro. I first installed eclipse Photon, which when starting up prompted me to install Java 6, which I did from https://support.apple.com/kb/DL1572?locale=en_US
Then I also installed the latest JRE (jre-8u171-macosx-x64 as of yesterday). When running eclipse again I started getting this error. Then I tried to run from the command line, and got this error:
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/eclipse/equinox/launcher/Main : Unsupported major.minor version 51.0
When googling that, the answers said that the reason for that is that the Oracle installer does not update the symlink in /usr/bin, which seemed to be confirmed by the fact that running java -version returned this:
java -version
java version "1.6.0_65"
The solutions I found for that were not feasible in MacOS starting in version El Capitan, and I am on High Sierra, so I followed the instructions in this post to fix that, and it worked, now I get:
java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
After all of this, however, I get the same "Failed to find a Main Class" error on the dialog as reported initially here, and the same "UnsupportedClassVersionError" on the CLI that I had when the system was still on java 6, so now I am still stuck and out of ideas.
EDIT: FIXED IT!!
I kept thinking that the problem was the java version, it was somehow still using java 6 (which I had installed due to the initial prompt).
So I followed the instructions here to remove what I had installed for the alleged java 6 issue. Then I found this post in the eclipse forums, which stated at the end (comment added by Eric Rizzo on Tue, 14 February 2017 21:56) that this is not an Eclipse message, but rather an OS message, and that one should NOT do that as apple messed things up with that patch. And then it goes to explain that one should install java 8 JDK (NOT just the JRE as I had done). Once I removed Java 6 and installed the full java 8 JDK, it ran fine :)
You can edit the eclipse.ini with your vm configuration in the beginning of the file
-vm
/yourJvmPath/jdk-12.0.1.jdk/bin/java
cat /Applications/Eclipse.app/Contents/Eclipse/eclipse.ini
-vm
/Users/SomeUser/jdk-12.0.1.jdk/bin/java
-startup
../Eclipse/plugins/org.eclipse.equinox.launcher_1.5.400.v20190515-0925.jar
--launcher.library
../Eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.1000.v20190125-2016
PD. It works with ApacheDirectoryStudio for MAC
This one works for me with MAC OS Mojave.
You can download the Java SE Development Kit 8u221 for mac from the below link.
jdk-8u221-macosx-x64.dmg
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Unity - Failed to compile resources with the following parameters:

I'm working on adding Google Play Game Services to a Unity project.
Started getting these errors recently, however not sure if it is because of the Game Services, or could be I updated my machine.
The following in Console output:
Failed to compile resources with the following parameters:
-bootclasspath "/Users/alex/development/adt-bundle-mac-x86_64-20131030/sdk/platforms/android-21/android.jar"
-d "/Users/alex/Documents/development/unity/Maze/Maze/Temp/StagingArea/bin/classes"
-source 1.6 -target 1.6 -encoding UTF-8 "com/facebook/android/R.java" "com/google/android/gms/R.java"
"com/google/example/games/basegameutils/R.java"
"com/google/example/games/mainlibproj/R.java"
"com/mildspring/maze/R.java" warning:
java/lang/Object.class(java/lang:Object.class): major version 51 is
newer than 50, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded. 1 warning
UnityEditor.HostView:OnGUI()
Error building Player: UnityException: Resource compilation failed!
Failed to recompile android resource files. See the Console for
details.
Got my answer, the issue was that "major version 51" is java 1.7, "version 50" is java 1.6. The solution was to install Java 1.7 and set path accordingly with the following command.
sudo ln -nsf /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK
For me, changing the JDK path at Preferences => External Tools => JDK finally resolved this issue. Creating the symbolic link wasn't enough or possibly not even needed.
I would just re-install or update JDK , And its work
http://www.oracle.com/technetwork/java/javase/downloads/index.html

MTurk Command Line Tools Error: Bad version number in .class file

I am using the Mechanical Turk command line tools on Windows. When I try to run a command (e.g., getBalance, createQualificationType), I always get the following error:
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
Any clues as to what I could look at to fix this would be greatly appreciated!!
I have tried updating my key and secret key to no avail.
Note: I can get help for the commands by using -help, but I cannot run the commands themselves.
This error occurs whether I am running either JRE 1.5.0_06-b05, 1.5.0_22-b03, or 1.7.0_17-b02. The command line tools documentation states, "You must have the Java JRE 1.5.X (JRE 5). The Command Line Tools are not 100% compatible with JRE 6."
Since I am using the version of the command line tools packaged with JRE, I have also uninstalled my JRE. I get the same error.
UnsupportedClassVersionError means that you are trying to use a Java class that was compiled with a newer JDK on an older Java runtime environment. For example, you have a class that was compiled with JDK 7, and you are trying to use it on a Java 6 or older runtime environment.
Java is downwards compatible; newer Java runtime environments can run Java classes compiled with older versions without modifications, but not the other way around.
Check with what version the class you are trying to use was compiled, and use a Java runtime environment with the same version or newer to run the class.
You can check your Java runtime environment and JDK versions with:
java -version
javac -version
Apparently, the CLT installer installs a JRE that is too old to run the tools included in the installer. Seems like a serious bug (certainly annoying).
You can fix by installing and using a more recent JDK.
This post contains instructions on how to do so:
https://forums.aws.amazon.com/message.jspa?messageID=388586#388585