I'm recently working on automatic building of android in Xamarin. I came across some guides and discussion but couldn't find a solution yet.
I realized that the walkthrough in reference (1) guided to use mdtool on iOS, however, msbuild on android. This gives me the problem due to different project configuration in some project. For instance, project A has configuration "Debug", "Beta", "Release", however project B only has "Debug" and "Release", and project A is the startup project.
In the situation above, let's say I would like to build project A with configuration "Debug", is has no problem as the configuration would just pass to all dependant projects. The problem comes when building "Beta" configuration in Project A. There is no way for me to inform the MSBuild that please use "Release" for project B and a complaint was thrown from MSBuild.
Also, I tried to build individual project without by supplying flag of /p:BuildProjectReferences=false, it seems that the dependant project is still build and same error was thrown.
I think I almost out of solution here and looking for expert from here. Any helps are welcome, thank you~
Exact command used for build:
"%MS_BUILD_PATH%\MSBuild.exe" /t:PackageForAndroid /p:BuildProjectReferences=false /p:Configuration=Beta "%SOLUTION_PATH%\%SOLUTION_NAME%
Reference:
http://developer.xamarin.com/guides/cross-platform/ci/jenkins_walkthrough/
http://forums.xamarin.com/discussion/2114/create-apk-from-command-line
Related
I'm trying to open and run the android architecture components sample project here: https://github.com/android/architecture-components-samples/tree/main/GithubBrowserSample in Android Studio. One one machine I'm able to get the project built and run just fine, but on my primary machine I'm seeing a build task error:
A problem was found with the configuration of task ':app:generateSafeArgsDebug' (type 'ArgumentsGenerationTask').
> No value has been specified for property 'enableGradleWorkers'.
I've tried the version of gradle and the gradle plugin that the project seems to have been built with, as well as the latest of each. I do have "android.enableGradleWorkers=true" specified in gradle.properties.
I haven't found this message when searching around, but I often see similar-looking errors when opening projects from different sources. I'd love to be able to fix this one, and ideally understand more about what to check when encountering build errors with projects from different sources in the future.
I'm using Android Studio with NDK, Gradle and CMake to build several shared libraries and link them together.
I keep getting the same error again and again in the build log:
:app:processDebugManifest [Passed]
:app:externalNativeBuildDebug [Passed]
Source C:\XXX\app\build\intermediates\cmake\debug\obj\arm64-v8a\libBGS-d.so and destination C:\XXX\app\build\intermediates\cmake\debug\obj\arm64-v8a\libBGS-d.so must be different
It's like gradle is trying to copy my library at the same position.
The thing is, I have no idea where this instruction comes from and how I can debug it. There's really not much indication in the build log.
What's confusing is that is doesn't occur 100% of the time. Seems like there is a race condition somewhere. Also sometimes it's another library that triggers the build to fail. Also, cleaning the project doesn't help.
So here's my question: is there any place where I can get granular control over the Gradle build sequence ?
According to Dan Albert at https://stackoverflow.com/a/62223434/8068814 this appears to be a bug and he suggests cleaning the project, then triggering "refresh linked c++ projects" and then building the project. Since it is sometimes working for you, this might be a reliable solution in your case.
For me this did not help, but reverting the Gradle plugin to 3.6.2 was the only way for me to build my project.
Not sure if this is the correct place for this but I have no idea what is happening.
I have installed Visual Studio, selected the Xamarin.Form development option. I then created a blank app called AwesomeApp. When I create ANY android simulator, I get the below error:
ADB0010: Deployment failed Mono.AndroidTools.InstallFailedException:
Failure [INSTALL_FAILED_INVALID_APK: Package couldn't be installed in
/data/app/com.companyname.awesomeapp-n7s-TVkN9lE8v1nea3tFZg==: Package
/data/app/com.companyname.awesomeapp-n7s-TVkN9lE8v1nea3tFZg==/base.apk
code is missing]
Has anyone experience this or even found a way around this? Following the suggestions only, such as cleaning the project, solution and rebuilding are not working. This happens with any project, no matter of the name or naming convention (i.e AwesomeApp or awesomeapp)
For me it's fixed by changing Dex Compiler from dx to d8 and disabling Shared Mono Runtime & Multi Dex
Upd:
A bit late but disabling Shared Mono Runtime is optional. Found out that it also works with it.
Try setting your project back to the current recommended defaults. Remove all of the following properties from the .csproj file:
AndroidEnableMultiDex
AndroidDexGenerator
AndroidLinkTool
AndroidDexTool
This will let Xamarin.Android pick the current latest default values.
I have in Android Studio a complex project establish by five modules. Four of them act as independent apps, but one of them is the base code for the rest. This way, I can have a big common core and four separates codes for every app (these apps share the shame model data and api connection).
My question is if it is possible rebuilding, cleaning or syncing just for one module, non the entire project in Android Studio.
Thanks!
Nowadays with Android Studio you can use build -> make module “nameModule”
sure, just use the project name when running Gradle, e.g. gradlew :api:build. This will build api module only.
More details in the docs.
I face the same problem,search for Google,No answer direct question.
I find Android Studio Menu,find the method .
Run - > Clean and Rerun"modle name"
For the addition the all of answer you can type a specific gradle task instead:
https://www.jetbrains.com/help/idea/work-with-gradle-tasks.html#gradle_tool_bar
In my case, Press ^ (macOS) twice -> Type gradle :your-specific-dfm:build
For the last 2 days I've been trying to simply get Google play game services Integrated into my game. I've followed the instructions here...
https://github.com/playgameservices/android-basic-samples/blob/master/README.md
...many many times. I have been trying to get it to build with Gradle but for now, I'll just focus on Eclipse building until that works. I've imported BaseGameUtils project into my workspace as an Android library project. My game android project has two Android library dependencies: google-play-services_lib and BaseGameUtils. Everything in Eclipse is showing without any errors. When I build and run on a real device, I see an error that says -
[2014-10-27 20:39:25 - BaseGameUtils] Could not find BaseGameUtils.apk!
I don't know why it's even looking for BaseGameUtils.apk since it should be an Android library. That said, I'm not sure how an Android library is really handled so maybe it should be a .apk. In any case, I couldn't find any information on this bug and the error message doesn't give me much to work with. I've tried adjusting things in the Build Path but no luck. I did have to remove some redundant dependencies in my Build Path earlier since I was getting some kind of duplicate DEX error but I'm not sure that's related in any way to this. I am desperate for help, anyone have any idea?
Can you try this? It has to do with conflicting methods of specifying that a project is a library.
I found the source of the problem!
It turns out that "with the new library feature, you don't specify the
Android projects you depend on in the Java Build Path section of the
Properties. You do it in the Android section of the Properties".
So all I had to do is go the Application Project's Properties, hit the
Projects tab, select my own library project and click the Remove
button. That's it. No more problem.
In Eclipse Java EE select the project Properties, then select Project
References, then check the FacebookSDK (see screen capture)
From: Android Eclipse - Could not find *.apk
If that doesn't help, you may want to double check that you selected "Is Library" in BaseGameUtils.
Also, when you hit "Run" in Eclipse, are you running your application and not BaseGameUtils?
Please would you check that BaseGameUtils has "is library" checked and that your application project DOES NOT have "is library" checked.
If this is correct, then please would you review the following in detail (especially as regards checking and unchecking "is library" ) :
Android Eclipse - Could not find *.apk
I presume that the DEX error related to two or more versions of the same lib. What is the specific GameHelper error ?
As a general point, I find it productive to get a sample project working first to ensure that I have got the environment working correctly before I start integrating game services into my own projects. If you have been changing the build path then it may be quicker to start from scratch and get a sample working. I have followed those instructions in the past and they are accurate.