I migrated from Ubuntu to Arch a couple of months ago. On Ubuntu, I built quite e few Android applications using CN1.
Now, on Arch, I am trying to build my first Android app with Maven and Eclipse, and went though the CN1 maven tuts.
After a learning curve, I got the project structured mounted and the simulator up and running, and today I wanted to install the app on my phone, but I received the following error :
Buildfile: /home/xxx/eclipse-workspace/xxx/xxxx/build.xml does not exist
I searched the entire project and the was really no such file present in any folder. (It should be automatically generated, right?)
Well, I tried to help myself and copied the build.xml file from a project that I generated from the templates to my maven project and created a couple of missing folders (like .../lib/impl/native/javase), but all to no avail.
The last error that's thrown is :
BUILD FAILED .../build.xml:434: Can't assign value '${codename1.version}' to attribute version, reason: class java.lang.NumberFormatException with message 'For input string: "${codename1.version}"'
What am I missing?
I think you're trying to use the plugin to send an Android build and it's looking for the old ant build file which is no longer there.
You need to use the appropriate launch script on Eclipse to send an Android build. The plugin is no longer needed when working with Maven as it's all handled by maven targets now.
Related
Note: this question/problem is regarding some Android build process, rather than a technical question about AdMob Plus itself.
I added AdMob Plus to my project, and well, at start, it was working. I have in my phone a working version of my ionic app, built with the --prod flag, that is showing the placeholder ad.
But after having some serious issues trying to sign the APK for the Play Store, I just started being unable to do absolutely anything with my project. I keep having this error regarding AdMob which I'm not able to solve:
Type admob.plus.core.Ad$1 is defined multiple times: C:\Zerok\Dev\Proyectos\Dromous\node_modules\#admob-plus\capacitor\android\build\.transforms\caf89848ec3f4a75afca2ab1d3cbcd43\transformed\classes\classes.dex, C:\Zerok\Dev\Proyectos\Dromous\android\capacitor-cordova-android-plugins\build\.transforms\031de8c5ab4ccc04dd0cc8127e017c43\transformed\classes\classes.dex
This is the output of the AdMob Doctor:
✖ googleads.g.doubleclick.net › RequestError: getaddrinfo ENOENT
googleads.g.doubleclick.net ✔ package.json ✔
cordova.plugins.admob-plus-cordova.APP_ID_ANDROID ↓ Cordova Android
dependencies [SKIPPED] ❯ config.xml ✖
platform[name="ios"]/preference[name="SwiftVersion"]: Error:
platform[name="ios"]/preference[name="SwiftVersion"]: missing /
invalid ✖ platform[name="ios"]/preference[name="deployment-target"]:
Error: platform[name="ios"]/preference[name="deployment-target"]:
missing / invalid ↓ platforms/ios/*.xcodeproj [SKIPPED] ✔
plugins/admob-plus-cordova/package.json ✔ admob-plus-cordova: 1.20.1
I tried following this stackoverflow question, but I don't see anything that has any impact on my project. The AdMob plugin is added just once, aswell the NPM library for the client code.
The other weird thing, is that you'd expect Gradle to care about the files in the /android folder, and not about the ones in node_modules. Why is it having a class collission with a file that's located outside the android folder? This doesn't make any sense.
I can't either build or do anything with my project as for now. I tried updating Android Studio, Gradle, cleaning and rebuilding the project, removing the Android folder and creating it again... and nothing.
Solved after a while! If you're using Ionic with Capacitor, and using some Cordova plugins, then you might bump into this very same problem.
The problem lies in the installation of the AdMob Plus plugin, but may happen when installing other plugins that have implementations both in Capacitor and Cordova. I'm still not sure what caused this, but somehow, installing the plugin for Capacitor, also added the plugin in the "capacitor-cordova-android-plugins" folder. This folder holds Cordova plugins for using them in Capacitor — that's how they get that compatibility with Cordova.
So, how does this apply to the error? Let's see it again:
Type admob.plus.core.Ad$1 is defined multiple times: C:\Zerok\Dev\Proyectos\myapp\node_modules\#admob-plus\capacitor\android\build\.transforms\caf89848ec3f4a75afca2ab1d3cbcd43\transformed\classes\classes.dex, C:\Zerok\Dev\Proyectos\myapp\android\capacitor-cordova-android-plugins\build\.transforms\031de8c5ab4ccc04dd0cc8127e017c43\transformed\classes\classes.dex
The class Ad$1 is being defined in two places. The first one is the legit one: it comes from a straightforward Capacitor-installed plugin. The second one, though, comes from that compatibility folder I mentioned earlier, capacitor-cordova-android-plugins.
When we enter that folder, and get into src/main/java, we can see classes for all the plugins that we're using in our Ionic app. In my case, this is what I could see:
Inside the com, cordova and org folders, I could find the classes needed for my Cordova plugins for which I didn't have a full Capacitor alternative. But AdMob Plus, which had, is also there.
Well, it shouldn't. Just remove the admob folder (or in your case, the double-defined plugin that is troubling you), and the app will begin to compile again.
I downloaded ARCore project and edited the project to run on older devices than Android 7.0 by following some online tutorial that simply editing the manifest file minsdkversion. Then I decompiled the code and signed it with my own debug keys. But all I see is a project without gradle and I am confused with everything at this point.Here is a screenshot of my whole project and gradle settings.
And when I try to run the project, I get this.
So my question is, where is Gradle file? Has anyone tried it and run into this kind of issues?
Do know for grale, but the error you get is the TestRunner, that runs the unit tests, this is not the main application launcher.
I am trying to set up a CI environment with Jenkins and Robotium. I want to use the same project for both built and test, but seems so tricky to get all working. I was wondering if someone had something like that working and if it can publish at least build.gradle and the project structure. Thanks.
Have been running in production for a few months now. See this question for a sample project and video of how to use robotium with gradle.
https://stackoverflow.com/a/23295849/1965124
As for the jenkins side of things:
Install the android sdk on the machine that will be running jenkins
set up android home variable
install the android plugin
run the following tasks from inside a jenkins job: clean connectedAndroidTest
after running 1 build (it will fail the first time), change the local.properties file to point to the local installation of the android sdk.
Let me know if you need any more pointers, its not as hard as I initially thought it would be.
I configured TeamCity as CI server. Also, project builds by Gradle.
The main idea is to execute gradle connectedInstrumentTest, that task will execute all project's tests on all connected devices, then it will put the test results in standard ant-junit format, so then you can set Jenkins to parse app-folder/build/instrumentTest-results/connected/*.xml test results.
If you got more questions, you can post them to the comments.
I've imported the tutorials from the gst-sdk folder in eclipse. But even after adding native support, i'm getting the error import to gstreamer cant be resolved.
The error is basically make.exe has stopped working. Hence, eclipse closes. So,i think the root problem occurs during th e phase of add native support. After that only, am not able to build my application or solve the errors.
There are currently issues with building ndk applications in Eclipse if you use Eclipse Juno or are running on Windows see the Using the NDK Plugin page for more information.
I have been able to get the tutorials to build and run by disabling the CDT builder in the Eclipse project and building the GStreamer libraries by running ndk-make via the command line. You can find more information in this post.
I built an android project that set up with android-maven-plugin. When I execute android:deploy and run the program, SharedPreferences always initialized.
Is there a way to deploy my project to AVD without deleting SharedPreferences storage?
P.S.
I use Intellij IDEA and noticed that its native android run/debug support does not delete SharedPreferences. However, after I add scala support on my project, IDE reports "Too many methods: 112423; max is 65536" error when I run the application. Perhaps it is due to lack of proguard preprocessing. If there are a way to apply proguard before run the android app with Intellij IDEA android support, it would be an equally effective solution.
I think your app is being uninstalled before being reinstalled again - this would cause you to lose your SharedPreferences values. This can be controlled with the Android Maven plugin parameter undeployBeforeDeploy.
I just tried to create a Maven project with the android-quickstart archetype and found that it automatically added the following line to my POM:
<undeployBeforeDeploy>true</undeployBeforeDeploy>
Try to set this to false and try again.
If you have it set to true, it prints this line in the console when you run mvn android:deploy:
[INFO] Successfully uninstalled [package] from [device]