Hello Android Developers,
I know from Android SDK , JDK and Gradle, we can create APK using command line but we still create project folder through Android Studio or other IDEs.
Can someone help, how to create android project folder using command line in mac?
Related
I created a flutter plugin for android and ios using the following command:
flutter create --org com.docscanner.ds --template=plugin --platforms=android,ios -i swift -a java complete_pdf_tools
The operation was carried out smoothly and then I opened android studio and clicked on the option Open and selected the folder created by the above command. The project opened but it shows error everywhere in all the .java files.
And also all the folders and files on the left are in yellow except lib folder.
This is how it looks:
I tried Invalidate Caches and android studio restart and system restart but no good. If I move cursor on top of any red colored word for example on embedding in 3rd line it says Cannot resolve symbol 'embedding' and for actions it suggests Find JAR on web and if I click on that action it says looking for Libraries and then says No libraries found for 'import io.flutter.embedding.engine.plugins.FlutterPlugin;'
The error is in .java files only. Same thing happens if I try to create the plugin from android studio itself by going New Flutter Project>and then it asks me for flutter sdk path, which is C:\src\flutter>now for project type i select plugin and select java for android and swift for ios, give project name, org name and finish
I am using windows 10 x64, flutter version stable 2.10.2, and Android Studio version Bumblebee 2021.1.1 Patch 1
What could be the cause of these errors.
Open example/android/build.gradle instead of android/build.gradle, then you have both app and plugin in your Project.
I've created a simple library to get JSON responses and map it to Java Object.
I built a JAR using 'build with dependencies' in IntelliJ IDEA with JDK 1.8. However, this JAR works when used with other IntelliJ IDEA projects.
However when I add in Android Studio Project, I get this Error:com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
I found on Reddit that some user did the same (built JAR with IntelliJ Idea and Imported in Android Studio)
I think I am missing something or a way to create JAR file which is causing incompatibility to Android Studio. I'm pounding my head for hours with no luck.
For Android Studio, change File -> Project Structure -> SDK Location -> JDK Location to jdk1.7.x. For the command line, ensure java -version outputs java version "1.7.x".
I had install all cocos2dx requirements for that . when I create an cocos2dx project this directory's created :
now I want to open it on the android studio . now when I open the proj.android-studio I can't run project and it's need to edit configuration . now which configuration should i do for run this hello world game ?
and consider this I am completely new in cocos2dx .
thanks for any help
Unfortunately there isn't a strong support for the Android Studio. You should first compile using
cocos compile -p android --android-studio
You should run this command in the projects home directory (that contains Classes, proj.android-studio... folders)
After running this, cocos will create an .apk file in the bin/debug folder.
You can try to run this .apk on your device or to get different builds you can import the proj.android-studio to the Android Studio and change the settings. But whenever you change a file in the classes folder, you have to compile it again.
For convenience, I am keeping two IDE (Visual Studio and Android Studio) and command line open. I am editing my c++ files in Visual Studio, I am compiling the code through command line, then I am trying to debug with Android Studio.
Drag and drop your project in command promte.Then run "cocos compile -p android --android-studio".For more information refer this video link
Now you can use Android Studio for game development using Cocos2dx
Requirements -
Cocos2dx-3.16
Android Studio (v3.0.1)
Update Android SDK (Update API 23 to API 19) Recommended
NDK r14b (Do not use r16. It has compatibility issue with cocos2dx)
python (2.7.14)
Steps-
Install python ( While installation use Add path to all local hard
drive )
Read readme.md file to configure the basic requirements for project ( Like setting environment path )
Create new Cocos2dx cpp project
Import the proj.android-studio folder into Android Studio
Change the supported platform. If you got any error
Configure project settings. Click Open->Project structure and put Min and Max API support
Modify Android.mk. Refer this
https://stackoverflow.com/a/48045723/2052113
Build project
Run Project ( Your sample android game is ready )
I'm developing Android apps without Eclipse or Android Studio. I use Lazarus+ZenGL (Object Pascal) to build a library loaded into a "fake" project.
All is working well, also Google Play Services for admob. If I need native calls, I can add these into the mainActivity.java file.
So I haven't an Eclipse project neither for Android Studio and I need to do everything (about compiling and building apk) by command line. This is not a big problem: a batch file does everything I need: aapt, javac, dx, android update, ant release, jarsigner and zipalign.
About Google Play Services I copied google-play-services.jar into my libs directory and updated project.properties with the right path:
...
android.library.reference.1=../../../../Android/sdk/extras/google/google_play_services/libproject/google-play-services_lib
...
The problem is that Google Play Services has his own jar, that I pass also into javac options, but BaseGameUtils has not.
I tried to follow tutorials, but no one explain how to add BaseGameUtils (and libs without jar) to a project by command line (updating project.properties with BaseGameUtils is not enough).
Without this lib I can't "import com.google.example.games.basegameutils.BaseGameActivity;" into mainActivity.java
I hope this is clear enough, I'm quite new about android dev and I'm using a very alternative way...
Thank you in advance!
I am a .NEt developer but recently i am having to deal with some android /java code. I downloaded Android OS's camera app source code from following location:
https://android.googlesource.com/platform/packages/apps/Camera
Now, I am having these files on my Windows 7 machine. When I do a simple search of "How to compile android apk code on windows" most of the searches result in saying that it is very non trivial and I need Mac or Unix machine for it.
Now, Looks like this is all bunch of java files. But I am not sure what should b emy target environment to try to compile all these files?
Follow these steps:
Download adt bundle here
Extract the zip and start ecllipse ide
Create a new emulator on which you run your application. It looks like a mobile icon.
then goto file->import->android->existing android project to workspace
Browse to your downloaded location select your project
Run