error: undefined reference to 'libiconv_close' in Ndk Android Studio - java

Iam getting error on setting up my ndk for gstreamer library in android studio.
Below is the error which iam getting-:
cerbero.git/1.16/build/sources/android_universal/armv7/glib-2.56.1/_builddir/../glib/gconvert.c:308: error: undefined reference to 'libiconv_close'
My project level gradle is -:
> buildscript {
> repositories {
> jcenter()
> google()
> }
> dependencies {
> classpath 'com.android.tools.build:gradle:3.5.0'
> } }
>
> allprojects {
> repositories {
> jcenter()
> google()
> } }
and my app.gradle is -:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "org.freedesktop.gstreamer.tutorials.tutorial_2"
minSdkVersion 9
targetSdkVersion 26
ndk {
moduleName "tutorial-2"
abiFilters 'x86', 'armeabi-v7a', 'arm64-v8a'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
externalNativeBuild {
ndkBuild {
path '../../gstreamer-tutorial2/app/src/main/jni/Android.mk'
}
}
}
Refrences which iam using is from-:
Gstreamer examples in Android Studio
Also can anybody help with good references for implemeting gstream library in android studio
Thanks

Try to add libiconv to your Android.mk file
GSTREAMER_NDK_BUILD_PATH := $(GSTREAMER_ROOT)/share/gst-android/ndk-build
include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk
GSTREAMER_PLUGINS := $(GSTREAMER_PLUGINS_CORE) $(GSTREAMER_PLUGINS_NET) x264 openh264 videoparsersbad mulaw
G_IO_MODULES := gnutls
GSTREAMER_EXTRA_LIBS := -liconv #This is what you need
include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer-1.0.mk

Related

Error:Plugin with id 'kotlin-android' not found. on android studio

I get this error when I add this to Android Studio
"Error:Plugin with id 'kotlin-android' not found.".
I am trying to install opencv on my android, but it will not work.
I made a new project in my Android that is empty but works
My build gradle
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
def openCVersionName = "4.5.4"
def openCVersionCode = ((4 * 100 + 5) * 100 + 4) * 10 + 0
println "OpenCV: " +openCVersionName + " " + project.buildscript.sourceFile
android {
compileSdkVersion 26
defaultConfig {
minSdkVersion 21
targetSdkVersion 26
versionCode openCVersionCode
versionName openCVersionName
externalNativeBuild {
cmake {
arguments "-DANDROID_STL=c++_shared"
targets "opencv_jni_shared"
}
}
}
buildTypes {
debug {
packagingOptions {
doNotStrip '**/*.so' // controlled by OpenCV CMake scripts
}
}
release {
packagingOptions {
doNotStrip '**/*.so' // controlled by OpenCV CMake scripts
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
sourceSets {
main {
jniLibs.srcDirs = ['native/libs']
java.srcDirs = ['java/src']
aidl.srcDirs = ['java/src']
res.srcDirs = ['java/res']
manifest.srcFile 'java/AndroidManifest.xml'
}
}
externalNativeBuild {
cmake {
path (project.projectDir.toString() + '/libcxx_helper/CMakeLists.txt')
}
}
}
dependencies {
}
I ran into the same error with Android Studio 2020.3.1 and fixed the error by adding this on top of the skd's build gradle (above 'apply plugin...'):
buildscript {
ext {
kotlinVersion = "1.4.0"
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
repositories {
mavenCentral()
}
}

Failed to resolve Ksoap2

I have a problem with Android Studio saying:
failed to resolve
com.google.code.ksoap2-android:ksoap2-android:3.6.1
Here is my build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.example.papiroomdemo.webservicetest"
minSdkVersion 15
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
repositories {
maven { url 'http://ksoap2-android.googlecode.com/svn/m2-repo' }
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.hannesdorfmann.smoothprogressbar:library:1.0.0'
compile 'com.github.castorflex.smoothprogressbar:library-circular:1.0.0'
}
Error:(30, 13) Failed to resolve:
com.google.code.ksoap2-android:ksoap2-android:3.6.1 Show in FileShow in Project Structure
dialog
I think your url in repositories section is invalid. You should add
https://oss.sonatype.org/content/repositories/ksoap2-android-releases/:
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
}
More info here: http://simpligility.github.io/ksoap2-android/getting-started
/// add these lines in module gradle
allprojects {
repositories {
google()
jcenter()
maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/'
}
}
}

Error:(18, 0) Gradle DSL method not found: 'android()' compile

I am new to Android and Android Studio so, I downloaded a project that I also need for my class then I got this error. I could not find my answer here, although there was a question like mine. Please help me to run this program that I downloaded from internet and solve this error, thank you.
These are my gradles:
apply plugin: 'com.android.application'
android {
compileSdkVersion 17
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "com.example.gettaxi"
minSdkVersion 8
targetSdkVersion 17
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:18.0.0'
}
And:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
}
}
allprojects {
repositories {
jcenter()
}
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.stackoverflow.answer"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dependencies {
androidTestCompile 'junit:junit:4.12'
compile fileTree(dir: 'libs', include: ['*.jar'])
}
}

Project Gradle sync keeps failing. (Gradle DSL method not found)

beginner android developer so not a lot of experience on how the gradle works, I've tried looking at other examples but I still cant get my problem. Basically, I've just downloaded one of the sample projects from google android developer examples, and cant successfully build the project. I keep getting: Gradle sync failed: Gradle DSL method not found: 'compile()'
The app gradle is:
apply plugin: 'com.android.application'
android {
enforceUniquePackageName = false
compileSdkVersion android_compile_version
buildToolsVersion android_version
defaultConfig {
minSdkVersion android_min_sdk_version
targetSdkVersion android_compile_version
versionCode 1
versionName "1.0"
}
lintOptions {
abortOnError false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile "com.android.support:appcompat-v7:${appcompat_library_version}"
compile "com.android.support:support-v4:${support_library_version}"
compile project(':libraries:BaseGameUtils')
compile 'com.google.android.gms:play-services:4.3.23'
}
buildscript {
repositories {
jcenter()
}
}
and as for the project gradle:
// this is the parent build configuration for all the sample projects.
// for more information on gradle build files when used in a multi-project build, see
// http://gradle.org/docs/current/userguide/multi_project_builds.html
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
}
}
// allprojects apply to every project
allprojects {
repositories {
jcenter()
}
ext {
android_compile_version = 23
android_version = '23.0.1'
android_min_sdk_version = 9
appcompat_library_version = '23.0.1'
support_library_version = '23.0.1'
gms_library_version = '8.1.0'
}
}

File not found while trying to compile Telegram source code

I am trying to build an app like Telegram.I downloaded their source code (https://github.com/DrKLO/Telegram) (for Android).
My main problem is that,when I try to compile the code and export it to my mobile phone,using Android Studio I recive this error:
Error:A problem was found with the configuration of task ':TMessagesProj:packageDebug'.
File 'C:\Users\Bogdan\Desktop\Telegram\Telegram-master\TMessagesProj\config\debug.keystore' specified for property 'signingConfig.storeFile' does not exist.
Obviously a file is missing,but which,and how can I solve this problem?
Thank you!
P.S. Can you please provide me with a link to the source code of an app similar like this one,or similar to whatsapp?
Change Telegram/TMessagesProj/build.gradle and remove or comment signing option in gradle config, like this:
apply plugin: 'com.android.application'
repositories {
mavenCentral()
}
dependencies {
compile 'com.android.support:support-v4:22.2.+'
compile 'com.google.android.gms:play-services:3.2.+'
compile 'net.hockeyapp.android:HockeySDK:3.5.+'
compile 'com.googlecode.mp4parser:isoparser:1.0.+'
}
android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
/**
signingConfigs {
debug {
storeFile file("config/debug.keystore")
}
release {
storeFile file("config/release.keystore")
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
}
*/
buildTypes {
debug {
debuggable true
jniDebuggable true
// signingConfig signingConfigs.debug
}
release {
debuggable false
jniDebuggable false
//signingConfig signingConfigs.release
}
foss {
debuggable false
jniDebuggable false
// signingConfig signingConfigs.release
}
}
sourceSets.main {
jniLibs.srcDir 'libs'
jni.srcDirs = [] //disable automatic ndk-build call
}
sourceSets.debug {
manifest.srcFile 'config/debug/AndroidManifest.xml'
}
sourceSets.release {
manifest.srcFile 'config/release/AndroidManifest.xml'
}
sourceSets.foss {
manifest.srcFile 'config/foss/AndroidManifest.xml'
}
defaultConfig {
minSdkVersion 8
targetSdkVersion 22
versionCode 572
versionName "3.0.1"
}
}

Categories

Resources