warren-bank / Android-Mock-Location

Android app that mocks the GPS and Network location providers.
GNU General Public License v2.0
141 stars 23 forks source link

Could not resolve project :Mock-my-GPS-UnifiedNlp-Backend-artifacts #16

Closed unicaap closed 1 year ago

unicaap commented 1 year ago

I am getting the error below when trying to build the project - where can I get the project Mock-my-GPS-UnifiedNlp-Backend-artifacts?

Could not determine the dependencies of task ':Mock-my-GPS:compileEnglishWithAospLocationProvidersDebugJavaWithJavac'.

Could not resolve all task dependencies for configuration ':Mock-my-GPS:englishWithAospLocationProvidersDebugCompileClasspath'. Could not resolve project :Mock-my-GPS-UnifiedNlp-Backend-artifacts. Required by: project :Mock-my-GPS No matching configuration of project :Mock-my-GPS-UnifiedNlp-Backend-artifacts was found. The consumer was configured to find an API of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.ProductFlavor:locationProvider' with value 'withAospLocationProviders', attribute 'com.android.build.api.attributes.ProductFlavor:languageResources' with value 'english', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.1' but:

  • None of the consumable configurations have attributes.
warren-bank commented 1 year ago

The most recent release is built from the most recent commit.. so I had no problem building these APKs. The issue must have something to do with your particular development toolchain.

I'm not currently in the virtual machine that I use for my Android development environment, so I can't give exact version numbers.. but my Android Studio version starts with 2021.. so it's recent but not bleeding edge.

All I do is "import an existing project", and browse to the "android-studio-project" directory.

unicaap commented 1 year ago

My bad, I did an "Open" rather than "Import". I can compile now. Thank you for the tip!

I have another question though - in your README, it mentions the ability to generate different APK variations. How do I do that ? I can't figure this part out. The only Run configuration I have after import is "Android-Mock-Location-service". Is there some additional configuration that needs to be performed?

warren-bank commented 1 year ago

off the top of my head.. I'd say the steps go (something) like:

  1. select from top menu: "Build" > "Generate Signed Bundle/APK"
  2. select: APK
  3. choose APK variation from the "Module" dropdown
  4. enter keystore path and credentials (or make a new one)
  5. choose the build variant.. which specifies a unique option for each available flavor dimension
  6. click: "Finish"
  7. wait for the APK to finish being built.. watch the log for any errors or warnings
warren-bank commented 1 year ago

there's also a "build variant" tab or button at the bottom left.. that lets you choose the default APK variation.. which (imho) is only necessary when choosing "Run" > "Debug".. since (when doing so) I'm not aware of any way to dynamically choose the particular variation to build.. which is then signed with the debug certificate.. pushed by adb to a connected device.. and attached to the debugger.

unicaap commented 1 year ago

Ok, if you have time, could you please let me know the Android Studio version you are using. I've been trying several versions and I get different errors like gradle/AGP version errors. :-(

unicaap commented 1 year ago

I've settled for 2021.3.16 but I can't get through the error below:

First with this info:

Task :prepareKotlinBuildScriptModel UP-TO-DATE

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.6/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 31s


Then with the error below:

Unresolved dependencies

No matching configuration of project :Mock-my-GPS-UnifiedNlp-Backend-artifacts was found. The consumer was configured to find an API of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'com.android.build.api.attributes.ProductFlavor:locationProvider' with value 'withGooglePlayServicesFusedLocationProvider', attribute 'com.android.build.api.attributes.ProductFlavor:languageResources' with value 'withAllLanguageTranslations', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.1' but:

warren-bank commented 1 year ago

I've been using Android Studio 2021.3.1.17 for the past 7 months. This is what was used to build the most recent release. Your version appears slightly newer.. so it should work fine.

warren-bank commented 1 year ago

update.. you were right, and I was very wrong..

today, somebody else made the same comment.. so I took a closer look.. and quickly realized that .gitignore had prevented an important directory from being saved to the repo.. I fixed it just now.. I'm really sorry! ..this was completely my bad