I'm getting “Error: No resource found that matches the given name (at value with value @integer/google_play_services_version)”

前端 未结 7 385
失恋的感觉
失恋的感觉 2020-12-29 01:27

I\'m developing an app on Ionic Framework/cordova, and when I try \"cordova run android\" I get this:

\"Error: No resource found that matches the give

相关标签:
7条回答
  • 2020-12-29 01:47

    Install and configure the Google Play services SDK properly. You don't need to hard code that value.

    • Add Google Play services as an Android library project.

    I have found that the play services libproject has to be imported onto the same physical drive as your project. (check the 'Copy projects into workspace' checkbox when you import)

    0 讨论(0)
  • 2020-12-29 01:47

    For anyone encountering this issue using Android Studio / Gradle, you just need to make sure that you have the right dependency in your grade file.

    1. You need to setup Google Play Services – https://developers.google.com/android/guides/setup (1. Debes configurar Google Play Services)

    2. If you already completed previous step then (si ya completaste ese paso entonces)… Let say that you have this Gradle: (suponiendo que ya tienes un archivo Gradle asi:)

      dependencies { compile fileTree(dir: ‘libs’, include: [‘*.jar’]) compile ‘com.google.android.gms:play-services-gcm:7.5.0’ }

    you need to add a single line for Gradle to include the Google Play Services library (solo necesitas agregar un solo renglon para que Gradle incluya la libreria de Google Play Services library)

    dependencies { compile fileTree(dir: ‘libs’, include: [‘*.jar’]) compile ‘com.android.support:appcompat-v7:21.0.3’ compile ‘com.google.android.gms:play-services-gcm:7.5.0’ }

    Is a bad practice to hardcode this value into the versions.xml file (se considera una mala practica “quemar” o dejar fijo este valor en el archivo mencionado)

    0 讨论(0)
  • 2020-12-29 01:56

    Copy the google-play services_lib library project to your workspace OR Import the library project to your eclipse.

    Click File > Import, select Android > Existing Android Code into Workspace, and browse the workspace import the library project.

    Right click on your android project. Goto properties. Choose Android on the left panel. Click on Add and browse the library project. Select the same. Click ok and apply.

    enter image description here

    checkout this link for reference. http://developer.android.com/tools/projects/projects-eclipse.html#ReferencingLibraryProject

    0 讨论(0)
  • 2020-12-29 01:57

    I solved the problem by copying the version.xml file from google play service lib.

    google-play-services_lib/res/values/version.xml 
    

    to my project

    MyApp/res/values/version.xml
    
    0 讨论(0)
  • 2020-12-29 01:57

    You need to add the play services library to your project. This doesn't work by jus adding an external jar. You need to import the play_services_lib project into your workspace. And then add this library to you project by going to

    Your Project -> Properties -> Android -> Library

    Checkout this link for detailed explanation on how to import the play_services_lib into your workspace

    http://developer.android.com/google/play-services/setup.html

    After this the error will vanish and you need not add any fixed value.

    0 讨论(0)
  • 2020-12-29 02:02

    For anyone encountering this issue using Android Studio and/or Gradle, you just need to make sure that you have the right dependency in your grade file. Again, do NOT hardcode this value into a versions.xml file..

    Gradle eg.

    dependencies {
        compile 'com.android.support:appcompat-v7:22.0.0'
        compile 'com.google.android.gms:play-services-gcm:7.5.0'
    }
    
    0 讨论(0)
提交回复
热议问题