Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8791531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:51:20+00:00 2026-06-13T22:51:20+00:00

Im trying to use libspotify for an android app but Im having some problems

  • 0

Im trying to use libspotify for an android app but Im having some problems building my c wrapper. Ive created a very small wrapper that only asks libspotify what its version is.

My folder structure looks like this:

jni
 |-libs
 |  |-Android.mk
 |  |-libspotify.so    (symlink)
 |  |-libspotify.so.12 (symlink)
 |  |-libspotify.so.12.1.51
 |
 |-include
 |  |-libspotify
 |     |-api.h
 |
 |-Android.mk
 |-spotifywrap.c

/jni/Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_SHARED_LIBRARIES := libspotify
LOCAL_MODULE := spotifywrap
LOCAL_SRC_FILES := spotifywrap.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
include $(BUILD_SHARED_LIBRARY)

/jni/spotifywrap.c

include <jni.h>
include <libspotify/api.h>

jstring Java_com_example_ndktest_MainActivity_getBuild(JNIEnv * env, jobject this)
{
    jstring result = (*env)->NewStringUTF( env, sp_build_id() );
    return result;
}

/jni/libs/Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := libspotify
LOCAL_SRC_FILES := libspotify.so
include $(PREBUILT_SHARED_LIBRARY)

When I run ndk-build I get this:

spotifywrap.c:6: undefined reference to `sp_build_id'

sp_build_id is part of the interface in api.h.

Any ideas on what Im doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:51:21+00:00Added an answer on June 13, 2026 at 10:51 pm

    I have a feeling that your directory structure within the jni subdirectory is what’s causing you problems. Try editing your Android.mk build file to add this:

    LOCAL_CPPFLAGS = -std=c++0x -D__STDC_INT64__
    LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
    

    Also, I have a feeling that you’ll need to copy libspotify.so to your top-level libs/armeabi directory to link successfully.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying use Thread but i have some problem (I am beginner at
I am trying use the onClick() function in an activity for an android app.
I'm trying to load libspotify in my android app using NDK. I'm using the
I am trying use a Java Uploader in a ROR app (for its ease
trying to use hibernate with my web app and getting following exception: Initial SessionFactory
I am trying use javascript regular expressions to do some matching and I found
trying to use the beforeSave hook with some server side validation and throwing a
I am trying use filehelpers class builder but I am kinda confused on what
I was trying use svn to find a checkin using svn log, but it
I am trying use std::copy to copy from two different iterator. But during course

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.