Having successfully converted one project to FCM, I'm running into problems converting my second. This project is unique as I prefer to keep it on targetSdkVersion 22.
This is my gradle file . . .
apply plugin: 'com.android.application'
android {
compileSdkVersion 'Google Inc.:Google APIs:22'
defaultConfig {
applicationId "com.myname.myapp"
minSdkVersion 21
targetSdkVersion 22
}
buildTypes {
debug {
debuggable true
}
release {
debuggable false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
dependencies {
implementation project(':library')
implementation project(':googleplayservices_lib')
implementation files('libs/gson-2.2.2.jar')
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.android.support:support-v4:22.2.1'
}
apply plugin: 'com.google.gms.google-services'
When I try to run the project on an emulator I get . . .
Program type already present:
com.google.android.gms.common.data.Freezable
I have no idea what this is about and google turns up nothing useful. However it appears to be caused by the firebase-core dependency because it I remove that, the project runs fine.
What might be causing this?
Related
I am using agora video call on my app and getting bellow errors on Android physical devices and emulators. There is no any problem on iOS yet. So I believe it's not about app_id is not correct.
here is error:
D/agora-jni( 4883): android bridge create done...
E/libc ( 4883): Access denied finding property "net.dns1"
E/libc ( 4883): Access denied finding property "net.dns2"
E/libc ( 4883): Access denied finding property "net.dns3"
E/libc ( 4883): Access denied finding property "net.dns4"
this is my app/build.gradle file:
...
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 30
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
applicationId "..."
minSdkVersion 19
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
...
signingConfigs {
release {
...
}
}
buildTypes {
debug {
minifyEnabled false
shrinkResources false
}
release {
signingConfig signingConfigs.release
minifyEnabled true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation group: 'com.google.android.material', name: 'material', version: '1.4.0-alpha02'
implementation platform('com.google.firebase:firebase-bom:27.1.0')
implementation "androidx.multidex:multidex:2.0.0"
implementation 'androidx.browser:browser:1.3.0'
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
I am using r8 shrink and proguard. My proguard-rules.pro file:
-keep class io.agora.**{*;}
And my gradle.properties file:
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
android.bundle.enableUncompressedNativeLibs=false
My pubspec.yaml file:
permission_handler: ^6.1.1
agora_rtc_engine: ^3.1.3
The message Access denied finding property "net.dns" shown on logs is just a warning as mentioned on this GitHub issue thread and shouldn't cause issues running the app. What you can do here is check if there's a different cause of the issue. See if you're able to get the user id if you're able to join a channel successfully.
I'm trying to get Mobile GTS' prebuilt Candy Jump app to run and build an APK in Android Studio. I've followed this video precisely: https://www.youtube.com/watch?v=YpYVdJVYWg0.
However, I am using Gradle 4.7, JDK 1.8.0, Android Plugin Version 3.1.2 and Build Tools Version 27.0.3. I'm not sure if that would have anything to do with why I can't get it to build, but I've had error after error and I've kind of boiled it down to what I hope is the last error.
Supplied String module notation 'libs/dagger-1.2.2.jar' is invalid. Example notations: 'org.gradle:gradle-core:2.2', 'org.mockito:mockito-core:1.9.5:javadoc'.
How can I fix this error?
Here's my build.gradle (module: app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "net.mobilegts.candyjump"
minSdkVersion 19
targetSdkVersion 27
multiDexEnabled true
ndk {
moduleName "player_shared"
}
}
buildTypes {
release {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
sourceSets.main {
jni.srcDirs = []// <-- disable automatic ndk-build call
}
productFlavors {
}
}
dependencies {
implementation('com.google.android.gms:play-services:+') { exclude module: 'support-v4' }
implementation 'libs/dagger-1.2.2.jar'
implementation 'libs/javax.inject-1.jar'
implementation 'libs/nineoldandroids-2.4.0.jar'
implementation 'libs/support-v4-19.0.1.jar'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:support-core-utils:27.1.1'
}
You should use "implementation files" for jar files. Try the following code:
implementation files('libs/dagger-1.2.2.jar')
implementation files('libs/javax.inject-1.jar')
implementation files('libs/nineoldandroids-2.4.0.jar')
implementation files('libs/support-v4-19.0.1.jar')
I am getting error after update to appcompat-v7:24.0.0-alpha1 on generating the signed apk.
Error:Error: Style Resource definition cycle: TextAppearance.AppCompat.Light.SearchResult.Title => TextAppearance.AppCompat.SearchResult.Title => TextAppearance.AppCompat.SearchResult.Title [ResourceCycle]
Temporary but Working Solution:
I was searching for the solution for about two days but I was unable to create signed apk, finally I found the answer on this thread: https://code.google.com/p/android/issues/detail?id=203407
Just put these 3 lines in your 'app' build.gradle file under android()
lintOptions {
checkReleaseBuilds false
abortOnError false
}
finally your build.gradle file will be like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '24.0.0 rc2'
defaultConfig {
applicationId "abc.xyz"
minSdkVersion 9
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
//Here the magic Begins
lintOptions {
checkReleaseBuilds false
abortOnError false
}
//Here the magic Ends
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('src/main/libs/YouTubeAndroidPlayerApi.jar')
compile 'de.greenrobot:greendao:2.1.0'
}
I hope this answer will help you. This will create your build, later when proper 24 support libraries release available, you have to change it properly.
Faced same issue, here's right fix for it.
Start your SDK Manager, goto Extras section, here you can see update for Support Library. Install it.
Then open build.gradle/app.gradle
change
compile 'com.android.support:appcompat-v7:24.0.0-alpha1'
to
compile 'com.android.support:appcompat-v7:24.0.0-alpha2'
Problem solved! cheers.
https://code.google.com/p/android/issues/detail?id=203407
check it for more details...
paste it in your Gradle of your project
classpath 'com.android.tools.build:gradle:2.1.0-alpha1'
compile 'com.android.support:appcompat-v7:24.0.0-alpha1'
compile 'com.android.support:design:24.0.0-alpha1'
compile 'com.android.support:support-v4:24.0.0-alpha1'
compile 'com.android.support:cardview-v7:24.0.0-alpha1'
Downgrade local maven repository for support libraries.
Reverting back to 26 solves my problems.
See https://code.google.com/p/android/issues/detail?id=203546#c10
I want to use OpenCV4Android in Android Studio. I downloaded OpenCV for Android from this link:
http://opencv.org/downloads.html
But, when I try to import it, I get different errors in Camera2Renderer.java like, Cannot resolve symbol 'camera2', Cannot resolve symbol 'CameraDevice', Cannot resolve symbol 'Size', and Cannot resolve symbol 'CaptureRequest'.
I have tried both methods available here:
OpenCV in Android Studio
http://answers.opencv.org/question/14546/how-to-work-with-opencv4android-in-android-studio/
But, I get the same error.
Can anyone please tell me how to solve this error to be able to use openCV?
Thank you.
I faced the same issue while configuring OpenCV SDK with Android Studio.
I am using the latest SDK build of OpenCV : OpenCV-3.1.0-android-sdk
Please ensure that you have configured your build.gradle scripts.
Build.gradle(Module: app) -->
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.example.dev.opencvapp"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets { main { jni.srcDirs = ['src/main/jni', 'src/main/jniLib/'] } }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
compile project(':openCVLibrary310')
}
Build.gradle(Module: openCVLibrary310) -->
apply plugin: 'com.android.library'
android {
compileSdkVersion 24
buildToolsVersion "19.1.0"
defaultConfig {
minSdkVersion 8
targetSdkVersion 21
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
After doing this you should be able to build the app with out any errors.
I hope I helped you!!
I am trying to learn android in android studio.Now i imported an eclipse project in android studio and now while trying to run it it is not building.Some problems in gradle may be..
Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : uses-sdk:minSdkVersion 8 cannot be smaller than version L declared in library com.android.support:support-v4:21.0.0-rc1
my build.gradle
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.example.practise"
minSdkVersion 8
targetSdkVersion 19
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:+'
compile 'com.android.support:gridlayout-v7:+'
}
Can anyone help me to find out the problem??
Change your dependencies
dependencies {
compile 'com.android.support:support-v4:19.1.0'
compile 'com.android.support:gridlayout-v7:19.1.0'
}
Using the +, you are getting the last release.
Currently the last release is the compile 'com.android.support:support-v4:21 and it has a minSdk='L' because it is a preview release.
Use it only to test the android 'L' preview.
Try editing the following line to your Android Manifest file, like so:
dependencies {
compile 'com.android.support:support-v4:21+'
}
Then your project should build.
Change your dependencies in app/build.gradle to lower version
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.eusecom.snowsmsden"
minSdkVersion 16
targetSdkVersion 20
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:20.+'
compile 'com.android.support:appcompat-v7:20.+'
}