How to remove metadata google_play_services_version? - google-play-services

I was coding, and appears to add one library, I pressed add and
compile 'com.google.android.gms:play-services-appindexing:8.1.0'
was added, but I DONT NEED IT (now)
then in manifest was added
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
but as I DONT need it, i delete both,
Now if I try compile
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
is automatically added again
and this error shows
Error:(66, 28) No resource found that matches the given name (at 'value' with value '#integer/google_play_services_version').
I repeat I DONT want to add it now.
and I have delete it in bundle

In Android Studio, open AndroidManifest.xml in other text editor remove those lines and save.
<!-- ATTENTION: This was auto-generated to add Google Play services to your project for App Indexing. See https://g.co/AppIndexing/AndroidStudio for more information. -->
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
And then rebuild project again.

Related

Base Directory path of different environments in nlog

I have .net core web api project with Production,Stage and Development environments. i used {baseDir} in filename of nlog target but when i run project it store log file in bin\netcoreapp3.1\netcoreapp3.1 folder.
I have a folder Logs and i want to store logs in this folder.
same in all environments i want that.
Anyone know how to do that please help me !!
for more detail :
nlog.config
<variable name="DefaultLayout" value="${longdate} ${processid} ${uppercase:${level}} ${logger:shortName=true} ${environment-user} ${local-ip} ${message} "/>
<targets async="true">
<target xsi:type="File" name="file" layout="${DefaultLayout}" fileName="${baseDir}\log-${shortdate}.log" />
</targets>
Thank you !!
The {baseDir} is the directory from which the code is executing, so what you're getting is correct.
If you want to use the content root path of your ASP.NET Core app you need to use ${aspnet-appbasepath} - ref.
You can specify it as fileName="${aspnet-appbasepath}\Logs\log-${shortdate}.log".
From the docs:
Introduced with NLog.Web.AspNetCore v4.5.0 and NLog.Web v4.5.2
Make sure you're targeting the respective version, otherwise you wouldn't be able to use ${aspnet-appbasepath}

React native image picker is not functioning properly

I have used react-native-image-picker and sometimes as soon I take picture from camera, app gets restarted in android? Can anyone help me with that issue?
This issue will only be on the android X or any latest android version. In order to resolve the issue you need to add the following line in the AndroidManifest.xml file.
android:requestLegacyExternalStorage="true"
I hope it will resolve your issue.
I solve this issue by add permission in AndroidManifest.xml.
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
It might be the camera permission issue. Make sure that you have given permissions for camera, microphone and gallery and this might solve your issue.
There is a privacy change in Android 10 and above by introducing Scoped Storage.
To opt-out of that feature by using requestLegacyExternalStorage manifest attribute:
<application
android:name=".MainApplication"
android:requestLegacyExternalStorage="true" ...
Note: This flag allows apps to temporarily opt-out of the changes associated with scoped storage, such as granting access to different directories and different types of media files. After you update your app to target Android 11, the system ignores the requestLegacyExternalStorage flag.
It's a best practice to use scoped storage unless your app needs access to a file that doesn't reside in the app-specific directory.
It might be problem with your permissions or node modules
1. Try adding permissions
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
2. Remove all node modules and install again like below
npm install
react-native link
Adding on to what #subhash posted, you'll want to edit the the AndroidManifest.xml which is located here:
/projectfolder/android/app/src/main/AndroidManifest.xml, right after the opening <manifest> tag. So it should look like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.projectname">
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Have you done this step? http://prntscr.com/hftojg
I was having trouble with that, and turned out it was permission was not provided.
One more advice when you install react-native-image-picker . You should install it manually. I don't see that automatically work well.
Hope it can help you.

Exception: Duplicate files copied in APK com/worklight

When try to build project after I include Worklight Library I received bellow error
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK com/worklight/wlclient/messages_it.properties
File1: C:\Users\user1\AndroidStudioProjects\DIMP_APP\DIMP_APP\app\libs\worklight-android.jar
File2: C:\Users\user1\AndroidStudioProjects\DIMP_APP\DIMP_APP\app\build\intermediates\exploded-aar\com.ibm.mobile.foundation\ibmmobilefirstplatformfoundation\7.1.0.0\jars\classes.jar
As you did not supply the steps you've followed to add the library to your project, I suggest to verify that you have followed the latest official steps to do so, from here: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/7.1/hello-world/configuring-a-native-android-application-with-the-mfp-sdk/
Essentially:
Create a new native project in MobileFirst Studio in order to have the latest SDK generated
Copy the worklight-android.jar, uicandroid.jar, bcprov.jar, and android-async-http.jar files from the generated NativeAPI folder to the new native Android application, in the /libs directory.
[Android Studio only] Right-click any of the added .jar files and select Add as library to add all libraries.
[Android Studio only] Create an assets folder under src\main
Copy the wlclient.properties file from the previously created MobileFirst native API folder to the new native Android application, in the /assets directory.
Add the following permissions to the AndroidManifest.xml file
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.GET_TASKS" />
Add the MobileFirst UI activity:
<activity android:name="com.worklight.wlclient.ui.UIActivity" />

popup:org.eclipse.jdt.ui.PackageExplorer not visible for Java projects

I'm writing a plugin for Eclipse to help me with some custom errors and warnings. Started by creating a new plugin project using the wizard, chose the option with the nature and markers in it.
This automatically added a menu item in the project's context menu (popup:org.eclipse.jdt.ui.PackageExplorer?after=additions)
This seemed to work for most projects. Except the projects i needed it for. The menu item simply does not show up for Java projects in the Package Explorer.
I only changed the default ?after to be ?before, so the menu-item is in a location that suited me better (for the projects that it does work on).
Screenshot if what i've got now
That shows it's working on a non-java project in the Package Explorer.
I also added the same menu-item to the Project Explorer, all works fine there.
Here is a link to the plugin.xml i currently have.
The project it DOES NOT work on, is a simple java project freshly generated from the Eclipse "New -> Java Project" wizard. Any other java project doesn't work either.
The project it DOES work on, is freshly generated from the "Plug-in Development -> Update Site Project" wizard.
Stuff i tried:
I know it is not the same as popup:org.eclipse.jdt.ui.PackageExplorer not visible, i'm adding the menu-item to the context menu of a project, not files or directories.
However, i did try using:
<adapt type="org.eclipse.core.resources.IResource">
<test property="org.eclipse.core.resources.contentTypeId" value="org.eclipse.jdt.core.IJavaProject" />
</adapt>
instead of the <instanceof> tags, which also did not work. in fact, removing the whole <instanceof> tag does not even work.
I know it is not the same as Eclipse plugin menu item is not visible, the generated plugin.xml used selection, which i later changed to activeMenuSelection because that matched the documentation, and what the Plug-in Selection Spy says it actually is. Again, no change.
I think it is not the same as How create popup menu item in PackageExplorer only for directories, but i did try to use the suggested code and toyed around with it, no luck.
So, to summarize:
This is my first Eclipse plugin, most of the GUI stuff is generated from the Plug-in Developent wizard. Now i hope a real wizard can lead me to the answers i seek.
The <adapt> tag gave me an idea to adapt the project to an IResource. Then check for natures from inside the <adapt> tag. And that seemed to work!
The Platform Expression Framework page at eclipse.org also helped me understand what each of the tags exactly do.
So, i think my problem was actually similar to the one i linked first (popup:org.eclipse.jdt.ui.PackageExplorer not visible). Feel pretty dumb about that now...
Relevant part of my current plugin.xml:
<visibleWhen checkEnabled="false">
<with variable="activeMenuSelection">
<count value="1" />
<iterate operator="and">
<adapt type="org.eclipse.core.resources.IResource">
<and>
<not>
<test property="org.eclipse.core.resources.projectNature" value="com.mycompany.converterhelper.javaFileNature" />
</not>
<test property="org.eclipse.core.resources.projectNature" value="org.eclipse.jdt.core.javanature" />
</and>
</adapt>
</iterate>
</with>
</visibleWhen>
And a link to the entire plugin.xml
I want to thank Calon for his time and effort :-)

Editing CodeBlocks WxSmiths project

I have an old project done in CodeBlocks WxSmiths. I copied it across to my new computer and now I cannot make any changes to the project! I can add items to a panel on the main frame (and the preview looks fine) but the changes are discarded when I compile and run the project. All I get is the old project executable without my new additions! (I did clean build as well). Or in other words a main frame cpp file and header file is not getting updated with the new changes I make to the form. The files are not read-only. Do anybody have any ideas as why this happens?
This most likely is the case when you have wxSmith files pointing to incorrect source files.
Open the project file (using your favorite editor) and check the Extensions xml tag:
<Extensions>
<code_completion />
<debugger />
<wxsmith version="1">
<gui name="wxWidgets" src="src/wxExampleApp.cpp" main="wxExample" init_handlers="necessary" language="CPP" />
<resources>
<wxPanel wxs="wxsmith/somePanel.wxs" src="src/somePanel.cpp" hdr="src/somePanel.h" name="windowTabPanel" language="CPP" />
</resources>
</wxsmith>
<envvars />
</Extensions>
Make sure that your src and hdr files point to the correct source files you have in your project.
Otherwise wxSmith won't be able to update those files based on the changes made from the RAD view.