I have so apps that use APK Expansion Files. I usually have build these apps with ant. But I want to add AdMob code to these apps and apparently there is no way to build an AdMob app from the command-line so I have to use Android Studio. I looked at these docs: http://developer.android.com/google/play/expansion-files.html and they do not tell me what magic incantation I need to use in my gradle file. Does anyone know?
Apparently there is no way to use APK Expansion Files if you are using Android Studio. (see https://code.google.com/p/android/issues/detail?id=173235) That kind of sucks. So I guess I go back to using Eclipse.
Related
I recently migrated to Capacitor 3, and it appears that a few things have changed in terms of generated an APK with Ionic/Capacitor. Previously you were able to use the CLI to sign and build your release version of the APK, but now it appears that you need to use the Android Studio IDE to do so.
I am unable to figure out how to build my app within Android Studio.
It does not appear that I have any options available under my Build menu once the IDE launches after running the build command. I can see all of my files in the IDE, but I am unsure of what to do next.
Does anyone have any suggestions on where to begin when trying to use Android Studio for the first time for a production build?
Can you still use the previous CLI commands to sign your app?
Edit
Here is a screen shot of my Build menu from Android Studio:
SDK Platforms:
SDK Tools:
Go to Build -> Generate Signed Bundle/APK and follow the steps. You can provide the previous key that you used for signing. More info here
I have tried the following official guide here:
https://developers.google.com/games/services/cpp/gettingStartedAndroid
Which explains how to integrate gpg C++ SDK into Eclipse using ADT. ADT is no longer supported by google and I cant see why wouldn't they explain how to integrate it into android studio since they seem to keep it up to date?
In their samples here:
https://github.com/playgameservices/cpp-android-basic-samples
They mention the fact that we need to use ndk r10e or earlier. Does that mean the latest NDK versions are incompatible with gpg C++SDK?
I however managed to get their samples compiled by a few modifications and changing my ndk version to 10 from what I had which was the latest 14. But then again I wasn't able to use their sample in my own game. I am using cocos2dx engine and no matter how much I tried to match gradle and .mk files it would not only fail, but also mess with the integrity of my build upon cocos2dx engine.
So what is the proper way of integrating gpg C++ SDK into android studio project which has a native environment already up and running? Where to place the content of the c++ sdk files and in what way should we alter the content of gradle and .mk files?
Use SDKBOX. SDKBOX Play or Google Play Game Services, depending on the needs.
In my particular case, I implemented a cross platform project in C++11 that uses CMake. I initially designed this project to work on PC (Windows, Unix), but now I realized that I can use it on mobile platforms too, without re-implementing the business logic on every platform. The project uses standard libraries: Boost, Poco, OpenSSL, Protobuf.
After a few searches I came to conclusion that this is not even an usual mode to put together native and managed code in Android.
Is it possible to add reference in a Gradle project in Android Studio to a native project that uses CMake?
Can NDK adopt the project in a simple manner if I compile everything in command line (assuming I don't use Android Studio)?
If it is possible, is it recommended at all?
Is it possible to add reference in a Gradle project in Android Studio to a native project that uses CMake?
Since Google announced Android Studio 2.2 that comes with cmake plugin, so it's possible to reference CMake project to android project.
Can NDK adopt the project in a simple manner if I compile everything in command line (assuming I don't use Android Studio)?
In my experience, i compile NDK in separate way and then link the static/shared library (.so file) to be used in android project. I used NDK while developing PDF Reader using mupdf here
Hope this helps.
it would be possible with android studio 2.2, mainly the android plugin for gradle makes it possible. you could look at some examples in:
https://github.com/googlesamples/android-ndk/tree/master-cmake
android studio directly reads-in your cmake scripts -- there is nothing like desktop systems that generate project files for their native IDEs ( Visual Studio or XCode ); so you might have to modify your existing cmake files to eventually make it to work for android studio.
as long as you build to the correct APK, command line or IDE does not matter too much. If you intend to ship source code, having your project ready with an IDE would be attractive.
Please see CMaker_Boost, build the Boost with the CMake at a configure time. Now it is tested on the Linux and Android, gcc and clang. This can be included to the gradle project in the Android Studio. I hope this helps.
I've been struggling with this problem for 2 days. I can't debug my application on my android device using Android Studio.
This is the error I get:
[INSTALL_FAILED_DEXOPT]
When I look at the logs, it says "zip archive does not include classes.dex"
So the problem is that classes.dex isn't being built into the APK. This is true since the file size of my APK is now around 1MB whereas it used to be around 1.3MB.
I have tried everything, but I have no idea why classes.dex isn't being built into my APK. Any help is greatly appreciated.
Joaquin
Try cleaning your build, and build the app again.. Make sure you've added the activities to the Android manifest. Once you get the apk use 7zip to view apk and check if there is classes.dex or use native zip viewer if on Linux. And if nothing still works try synchronizing the build files so that gradle can detect non ide changes.
I just tried disabling my antivirus (Avast), cleaning and rebuilding the app and then restarting Android Studio.
Those steps worked and I can now debug my application on my android device again.
Note that classes.dex is only generated if your project contains Java classes. So if you are using the NDK in combination with native activities, there won't be no Java code at all and therefore no classes.dex. In that case, you have to set the hasCode attribute in the manifest to false because otherwise dexopt will be looking for it.
http://developer.android.com/guide/topics/manifest/application-element.html#code
I have got some open source projects which I want to have a try. But I want to use Eclipse if the project was made using eclipse; otherwise I would like to use Android Studio.
So how can I know by viewing the source code about the IDE used for the development of a particular project? Is there any metadata in any file which stores the IDE information?
I believe that Android Studio sometimes includes gradle related files. That's how I would check.