I used to be able to run this without problem to get to the databases folder of my Android App:
window.resolveLocalFileSystemURI('file:///data/data/{package name}/databases',
function (entry) {
alert(entry.fullPath);
}, rlfsOnErrors);
However, the statement returns error when I am using file-transfer plugin v0.4.2. When I switched back to file-transfer plugin v0.3.3, there is no problem. When I am using v0.4.2, I can only gain access to file:///data/media/xxxx directory and not file:///data/data/xxxx.
Anyone has any idea how I can workaround this ? Currently, I am sticking to v0.3.3, but I am sure there is some way to workaround this ?
Thanks.
Related
I have managed to connect a device ( I see logs and see the tree of React Native elements), but now I have an issue with connecting the app - "NO APPLICATION SELECTED" is what I see. Any ideas to fix it?
Ran into the same problem on both iOS and Android with Flipper 0.135.0. Managed to make both work by following the steps below.
iOS
This answer solved the issue for me.
tl;dr
brew update && brew upgrade idb-companion
Also make sure you are installing the correct Cocoapod of Flipper by specifying the exact version in your Podfile with (for version 0.135.0)
use_flipper!({ 'Flipper'=> '0.135.0' })
Android
Ensure that ReactNativeFlipper.java is in the correct folder, as in this example project.
With for example the applicationId com.domain.appName, the correct path is
android/app/src/debug/java/com/domain/appName/ReactNativeFlipper.java
In my project this Java file was in the incorrect folder, which resulted in the Logcat error
java.lang.ClassNotFoundException: com.domain.appName.ReactNativeFlipper
Ensure that you are running the latest version of Flipper (0.120.0 as of this message) and then:
For Android:
Bump the FLIPPER_VERSION variable in android/gradle.properties, for example: FLIPPER_VERSION=0.120.0.
Run ./gradlew clean in the android directory.
For iOS:
Call use_flipper with a specific version in ios/Podfile, for example: use_flipper!({ 'Flipper' => '0.120.0' }).
Run pod install in the ios directory.
Reference: https://fbflipper.com/docs/getting-started/react-native/#using-the-latest-flipper-sdk
Go to settings and check if the path for your Sdk is correct
In my case issue was with the Emulator OS and API.
I used following combination and it worked:
Device: Pixel 4a
OS: Android 12
API: (Release Name: S, API level: 31, ABI: arm64-v8a, Target: Android 12
I also faced this issue, I was not seeing android simulator and the app to select, but it was working fine for iOS without any config.
The problem with my setup was that in the Flipper settings, the android SDK's path was not correct, after updating the path and restarting Flipper, it automatically detected the simulator and the app.
Hope this helps.
I was able to solve that on Android, open ReactNativeFlipper.java file
In the first line package com.yourappname; change it to exactly your package name inside AndroidManifest.xml
In the MainApplication.java there is a line like
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
inside onCreate() function. In my project this line was commented. I removed the comment and run react-native run-android and flipper get connected to the app
I'm using cordova-plugin-mfilechose in my Ionic 4 application. It works fine till Android version 9. But in Android 10 whenever we trigger the plugin it just opens a window saying Internal storage but no file is listed, though there are many files inside the phone. I have used the same code as per the official documentation, added below. Thanks in advance.
window.plugins.mfilechooser.open(['.doc', '.xls', '.ppt'], function (uri) {
alert(uri);
}, function (error) {
alert(error);
});
The plugin looks like it is using standard Java File operations and paths to choose files, in Android 10 and above you cannot use file paths or Java File operations any more on anything but your App's private directory.
See https://developer.android.com/training/data-storage/files/external-scoped
Also not sure why you would use such a plugin as Android provides the functions natively with Storage Access FrameWork(SAF) or MediaStore
See https://developer.android.com/guide/topics/providers/document-provider#client
on how.
Everything can now only work with Java FileDescriptor
I found a workaround to my problem. Though it is not a solution in long run. In my Ionic 4 project project/config.xml android-targetSdkVersion was 29. I changed it to 28. Which works on Android 10 and also on all the lower versions. Below is the code.
<preference name="android-targetSdkVersion" value="28" />
I think all ionic plugins like cordova-plugin-camera and cordova-plugin-telerik-imagepicker needs to update to fully compatible with android 10 for scoped storage.
I am developing an android app based on ionic 2 using typescript.
I would like o open a PDF file inside my app with another app that is registered for the fyletype (e.g. Acrobat Reader).
Therefore i tried the two standard plugins:
https://github.com/disusered/cordova-open
https://github.com/pwlin/cordova-plugin-file-opener2
Although ive added both plugins via "ionic plugin add ..." and of course played around with several combination referencing to it
the result is always that they ere not found
cordova-open
var open = cordova.plugins.disusered.open;
Property 'disusered' does not exist on type 'CordovaPlugins'.
cordova-plugin-file-opener2
cordova.plugins.fileOpener2.open(
filePath,
fileMIMEType,
{
error : function(){ },
success : function(){ }
}
);
Property 'fileOpener2' does not exist on type 'CordovaPlugins'.
I am running the app on an emulator via ionic run android
Could you please give some hint how i can achieve to use one of these plugins?
Thank you very much
Shane
I'm trying to add the android platform using this command "platform add android error" but I get this error: http://i.imgur.com/C3ShDqn.png
My user folder is "C:\Users\Cretu Eusebiu" but in that error it's says only "C:\Users\Cretu" so I guess is something wrong with the space ?
I've set all paths for npm, android, ant and java.
Thank you.
It was not because of my username with spaces, it was from the spaces of the path where I created the app "C:\Google Drive\Android Apps".
We are using Phonegap 3.1.0-0.15.0 and the application chocked when trying to access location information.
Works fine in iOS however the App chock on Android
We are using:
navigator.geolocation.getCurrentPosition(app.location.onSuccess, app.location.onError);
and we also tried:
var geo = cordova.require('cordova/plugin/geolocation');
geo.getCurrentPosition(app.location.onSuccess, app.location.onError);
The logcat mentioned the following:
Could not find cordova.js script tag. Plugin loading may fail. at file:///android_asset/www/phonegap.js:1511
Uncaught module cordova/plugin/geolocation not found at file:///android_asset/www/phonegap.js:56
The plugin was added using:
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git
Are we doing something wrong ?
Thank you in advance
/Edwardo.
Just to answer my own questions. I removed all the plugins manually and then add them (including the problematic geolocation plugin) using the following command:
phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git
That solved my issue.
Edward.