error resource bool fb_auto_log_app_events_enabled - android

I had an error when compiling my app
error resource bool fb_auto_log_app_events_enabled managed to fix it
add bool.xml
to android/app/src/main/res/values/bool.xml
the files
<bool name = "fb_auto_log_app_events_enabled"> true </bool>
<bool name = "fb_advertiser_id_collection_enabled"> true </bool>
enter image description here

This issue shows upon running ionic cordova build android, what I did was to add a new file bool.xml inside platforms/android/app/src/main/res/values
inside bool.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="fb_auto_log_app_events_enabled">true</bool>
<bool name="fb_advertiser_id_collection_enabled">true</bool>
</resources>
then run again:
ionic cordova build android

Related

styles.xml file is not generated by android studio? Theme module is there inside values module

[
Is there any specifications of API level where that file will be generated.
Create new resource file in values package:
Name your file:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--Code here-->
</resources>

Flutter, how to have release and debug app on the same device?

I'm working with flutter on an application (only android for now) which can be downloaded from Google Play.
I have installed the released app on my phone. However, whenever I launch the debug on my device with android studio, it is deleting the released version.
What I would want is having both apps at the same time, like "App" and "App_debug" on my device.
How can I set up my project so there is no conflict between the debug and the release app ?
Thank you.
I managed to found a solution (only for android).
To not delete the "released App" download from Google Play, I add these lines in the file android/app/build.gradle:
android {
buildTypes {
// ------ Start Changes -----
debug {
applicationIdSuffix ".debug"
}
// ----- End Changes -----
}
}
In that way the package will be com.example.app for a release app and com.example.app.debug for my debug app and there is no conflict anymore.
However I also wanted a different app name so I can differenciate both apps.
To do so I followed this comment:
In the file android/app/src/main/AndroidManifest.xml I made this change:
<manifest ...>
<application
// before : android:label="App"
android:label="#string/app_name" // <- After my changes
>
</application>
</manifest>
Then to set up the name for the release app, create or modify the file android/app/src/main/res/values/string.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">App</string>
</resources>
And for the debug version, create or modify the file android/app/src/debug/res/values/string.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">App Debug</string>
</resources>
What're you looking for is called flavors. You can check out more info about it in the flutter official docs or checking out these packages:
https://pub.dev/packages/flutter_flavor
https://pub.dev/packages/flutter_flavorizr

Android instrumented test - test resource not resolved

I want to have androidTest resources specific to each app flavor. I found an answer on this site that indicated you can just make a resource directory androidTestFlavorName and it will be managed like all the other resources. So I have a directory app/src/androidTestFlavorName/res/values and a file strings.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test_sec_code">aStringValue</string>
</resources>
I have a test class app/src/androidTest/java/com/company/package/StartupTest.kt. In that class:
val code = context.getString(R.string.test_sec_code)
test_sec_code is red, so the IDE doesn't like it, and the compiler reports: Unresolved reference: test_sec_code
My selected build variant is flavorNameDebug. So am I setting up these resources wrong, or is my goal not possible?
Edit:
I tried putting the resource in app/src/androidTest/res/values/strings.xml and it can't be found there either. Surely there must be a way to define test resources right? Hello, is this thing on?

Android Build Failed, strings/google_app_id duplicate resources error

I am working on ionic 4. When I run this command in cmd:
ionic Cordova build android
It gives me a duplicate resource error. I am using firebase and google services.json plugins in my project.
I have tried to remove google_app_id and google_api_key from Andriod.xml file but no change. The same error is displaying again and again. Here is the view of the android.xml file.
Android.xml File
"res/values/strings.xml": {
"parents": {
"/resources": [
// removed google_app_id & google_api_key
]
}
}
}
Strings.xml File:
<resources>
<string name="app_name">UrbanX Driver</string>
<string name="launcher_name">#string/app_name</string>
<string name="activity_name">#string/launcher_name</string>
<string name="google_app_id">#string/google_app_id</string>
<string name="google_api_key">#string/google_api_key</string>
</resources>
Config.xml File:
<resource-file src="google-services.json" target="app/google-services.json" />
Install this plugin cordova-android-play-services-gradle-release:
ionic cordova plugin add cordova-android-play-services-gradle-release
check this link for reason:
https://github.com/arnesson/cordova-plugin-firebase#google-play-services

Compiling error with Android Phonegap app

I'm using Phonegap and Barcode Scanner plugin. I'm trying to build an test application. I'm following below tutorial.
http://www.mobiledevelopersolutions.com/home/start/twominutetutorials/tmt3
I have paste the BarcodeScanner.java to the correct path, as you see in the image.
But when compiling following error happens:
Android Packager: [phonegapbarcode] C:\Users\achintha_s\IdeaProjects\Barcode PhoneGap\AndroidManifest.xml:59: error: Error: No resource found that matches the given name (at 'label' with value '#string/share_name').
How can I solve this? I'm using IntelliJ Studio.
Check the strings.xml in values folder of res folder whether there is a string with name share_name as below:
<string name="share_name">My App Name</string>
and the strings.xml file should like this:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="share_name">My app Name</string>
</resources>
Make sur you've a stringname share_name in your String.xml file.
<string name="share_name">My App</string>

Categories

Resources