I'm little confused about project properties, Java Build Path, Order and Export when compiling an Android project.
Look at this:
Should I check Android 2.3.3, Android Dependencies and android.jar ?
when compiling my android project to be sure that everything will works fine on the destination device. My doubts arise because I get an error on some devices, please look at my previous question:
Exception java.lang.NoSuchMethodError on java.util.Deque.push
It's not related to your exporting. Your project references java.util.Deque which was only added in API level 9
(http://developer.android.com/reference/java/util/Deque.html)
Devices with API level < 9 will fail as they cannot call this Class/method as it doesn't exist on them.
Related
I'm trying to build a Flutter app that also runs custom Java code, so that I can execute code in the background, set alarms etc. As such, I'd like to access Firebase from Java.
I've created a new Flutter project in Android Studio and added Firebase as documented here (manually).
It compiles and runs fine on the device, but it seems that the dependency .jars from Gradle are not picked up in Android Studio, and as a result my Java source files show a lot of errors - source being "cannot resolve symbol 'google'" in the import statements.
Is there anything special that I need to do in order to have Android Studio pick up external Java dependencies from Gradle in Flutter application projects? I'm running Android Studio 3.0 Beta 7.
I have the same issue and would love to find the solution. I tried directly downloading the .aar file and using this guide but it did not work either.
https://github.com/yushulx/flutter-android-aar
Edit: I found an open issue on the topic which can be found here. Clearly you have found it, but in case anyone else is looking for more information about this.
Edit 2: Here is a workaround.
I'm trying to make a cross-platform project using C++ on Windows and the Android NDK. I've been trying to put it together in one project with multiple build configurations, but I'm running into a problem for the Android build.
My project directory structure is as follows:
PROJECT/
src <- This has the Android SDK files
jni <- This has the Android NDK files
src-mp <- Multiplatform C++ code
src-pc <- Windows-specific code
gen
res
...
When building for Android, the src-pc folder contains code that doesn't compile and generates errors (it's using GLFW and GLEW, which doesn't seem to be compatible with Android). I right-clicked on it and hit
"Resource Configurations -> Exclude from Build".
However, the errors in src-pc are still being reported and so Eclipse refuses to run the application. I know the application runs on Android without the src-pc folder.
I suspect it's something with the indexer, but I can't get it to ignore the files in the src-pc folder. I've considered setting up a separate dependent project for Windows, but I was hoping that there was a way to put it all in one project. I've looked at the resource filters functionality, but I don't see a way to set filters for specific build configurations, so that doesn't help.
I already found that it's possible to delete the problem reports in the Problems tab, but doing that every time I build is a nuisance and I was hoping for a better fix.
I'm using Android NDK R9D and the SDK tools for API level 19. I'm on Eclipse Kepler. The toolchain being used for C++ compilation is Cygwin GCC with the Android Builder.
I implemented the current version of ActionBarSherlock to my Android Project.
Everything works fine and I don't get any errors.
But when I try to debug or export my project I don't get an .apk-file out of my project. Just a .jar-file with the name of my project.
I've read about some problems the SDK had with building projects that contain external libraries but this was at SDK version 14 and so I hope, this bug is fixed...
So there might be another cause for this problem.
Does anybody know a possible solution?
You cannot get *.jar file as the result of building Android project. This seems very strange to me. There must be something wrong with your project settings (if you changed them), or the project you build is of the wrong type (i.e. it is Java Application instead of Android Application).
You didn't mention which IDE do you use, but I assume you use Eclipse.
Make sure you have installed Android SDK and Eclipse ADT correctly (just in case).
Next thing to try is to create a new Android Application project from existing sources (there should be such option during the process of creation).
I am developing an Android application which makes use of the Osmdroid maps api. I have added the library as an external jar in my build path and I do not get any errors during compile time. However, upon device deployment I get the following error:
03-27 16:18:50.986: E/AndroidRuntime(3306): java.lang.NoClassDefFoundError: org.osmdroid.util.GeoPoint
I have done some googgling and it is still a mystery to me.
Here is my IDE configuration.
Eclipse: Indigo Release version 2
Java SDK: 1.6.0_31
Android SDK: 17
You need to go into Build Path/Order and Export, and check the libs as of SDK 17. Then clean your project.
I doubt about you and your project. From my viewpoint, I see you have a good design. But why are you working with Build Path / Order and Export? Honestly I've never gone to that tab from the first day I worked with Eclipse.
To import jar files as libraries, use tab Libraries -> add external Jars.
And I'm sorry I don't know about game programming, this is just a suggestion: make sure your engine fits what Android supports. For example Android doesn't support javax.imageio. If not, the app can be compiled with external jars, but can be crashed in runtime.
I've been tearing my hair out over this one, for the past 3 hours I've been trying to fix it but have been unable to. I've created an android app and I'm ready to put it on the android market but I get this error when trying to export to an apk.
Unable to execute dex: Multiple dex files define Lcom/google/ads/Ad;
I've read a bunch on the problem and tried quite a few solutions but nothing has seemed to help. I've cleaned and rebuilt, I've delete the bin folder, I've made sure that the bin folder is excluded build path. Nothing's worked. If anyone could help me I would really appreciate it.
Untick the admob jar file in the "order and export" part of the "configure build path".
On another post with a problem similar to yours the only thing mentioned that you have not already considered was updating Eclipse. I don't know how or what order that you have done these "fixes" but another poster mentioned that all at once he deleted the bin directory for his project, cleaned and rebuilt the project and restarted Eclipse. After that the error disappeared.
Good Luck- Lijap
For me the error was due to 2 different versions of AdMob SDK being included accidentally.
Removing one of them fixed it.
As other have noted, this problem should be due to multiple versions of Goodle's ad SDK classes being included in the app build. What I haven't seen yet is a note that the most recent Google Play Service lib includes classes that (at least) share the same names as some in the admob sdk-- for example, I came upon this error because I was trying to build with both admob sdk v.4.0.4 and the google-play-services_lib project as a referenced project; the latter contains google-play-services.jar which contains the package com.google.ads and many of the same classes as the admob sdk. Thus it appears that the google play services lib and the admob sdk cannot both be used in a given app. My solution was to remove the admob sdk entirely from the build.
I had the same or a similar problem. My problem was that my application imported a library which used a different version of AdMob SDK.
Details of my problem:
Library used AdMob SDK 6.3.0
Application used AdMob SDK 6.1.0
Fixed it by including the same version.
For me, I just have to take out the libs folder which contains android-support-v4.jar from build path and it worked.