Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt - package android.support.v4.app does not exist

Tags:

java

c++

android

qt

I'm using Qt 5.4. I imported SDK & NDK.

enter image description here

Actually, I was trying to use multiple line notification and I used this line in java file:

customMainActivity.java:

   import android.support.v4.app.NotificationCompat;
   NotificationCompat.Builder builder = new NotificationCompat.Builder(
                        context);

I'm getting an error : package android.support.v4.app does not exist
I read it and it and added android-support-v4.jar and android-support-v7-appcompat.jar but I don't know how to fix it in Qt.

like image 330
Farzan Najipour Avatar asked Jul 07 '15 07:07

Farzan Najipour


1 Answers

  1. Add Google's Maven repository to build.gradle https://developer.android.com/studio/build/dependencies#google-maven

    allprojects {
        repositories {
            jcenter()
            maven {
                url 'https://maven.google.com'
            }
        }
    }
    
  2. Add dependency to support-v4 library to build.gradle

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar']) 
        compile "com.android.support:support-v4:24.+" 
    }
    
like image 78
Libor B. Avatar answered Sep 30 '22 07:09

Libor B.