I am trying to develop an app that takes photos, and later that uploads them to a database. Right now I am stucked at taking a good quality photo. As I read before, to get a better quality photo you need to save it in your directories. I am following the Google Take Photos
from developers instructions, and after adding all the methods and provider and so on, I get the error :
Couldn't find meta-data for provider with authority com.example.navigationdrawerfinal.
I’ve left the name of my app so everyone can see that I changed it in manifest too.
Manifest:
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.example.navigationdrawerfinal.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
file_paths.xml :
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="my_images" path="Android/data/com.example.navigationdrawerfinal/files/Pictures" />
</paths>
and the code where I use it:
private void dispatchTakePictureIntent() {
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
// Ensure that there's a camera activity to handle the intent
if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
// Create the File where the photo should go
File photoFile = null;
try {
photoFile = createImageFile();
} catch (IOException ex) {
// Error occurred while creating the File
}
// Continue only if the File was successfully created
if (photoFile != null) {
Uri photoURI = FileProvider.getUriForFile(this,
"com.example.navigationdrawerfinal",
photoFile);
takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);
startActivityForResult(takePictureIntent, REQUEST_TAKE_PHOTO);
poza_neincarcata.setVisibility(View.GONE);
poza_tick.setVisibility(View.VISIBLE);
}
}
}
private File createImageFile() throws IOException {
// Create an image file name
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
String imageFileName = "JPEG_" + timeStamp + "_";
File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);
File image = File.createTempFile(
imageFileName, /* prefix */
".jpg", /* suffix */
storageDir /* directory */
);
// Save a file: path for use with ACTION_VIEW intents
currentPhotoPath = image.getAbsolutePath();
return image;
}
-
Marwin -
29. Mai 2011 -
Geschlossen -
Erledigt
-
- #1
Hey, heute sollte mein Server eigentlich Public kommen.
Ich hoffe ihr könnt mir noch helfen.
1. Ich habe die resourcen auf dem server.
2. Ingame steht Failed to load.
Zitat
2011-05-29 18:34:46] ERROR: Unable to start resource resourcebrowser;
[2011-05-29 18:34:46] ERROR: Unable to start resource resourcemanager;
[2011-05-29 18:34:46] ERROR: Unable to start resource webadmin;
[2011-05-29 18:34:46] ERROR: Unable to start resource race;
Alles anzeigen
Was kann ich tuen ? hab schon probiert entpackt oder als .zip etc etc.
Hilfe bitteMFG
-
- #2
Gibt es davor nicht noch eine andere Fehlermeldung?
-
- #3
Hier einmal alles.
===========================================================
= Multi Theft Auto: San Andreas v1.0.4-release-2106
===========================================================
= Server name : Race 1.4 [Testing]
= Server IP address: 188.138.79.6
= Server port : 4200
=
= Log file : ..server31796/mods/deathmatch/logs/server.log
= Maximum players : 32
= MTU packet size : 1264
= HTTP port : 22004
===========================================================
[2011-05-29 18:42:23] ERROR: Couldn’t find meta.xml file for resource ‘Server Maps’
[2011-05-29 18:42:23] Loading of resource ‘Server Maps’ failed
[2011-05-29 18:42:24] ERROR: Couldn’t find meta.xml file for resource ‘br-sf’
[2011-05-29 18:42:24] Loading of resource ‘br-sf’ failed
[2011-05-29 18:42:24] Resources: 66 loaded, 9 failed
[2011-05-29 18:42:25] Querying game-monitor.com master server… success!
[2011-05-29 18:42:25] Querying backup master server… success!
[2011-05-29 18:42:25] Starting resources…….
[2011-05-29 18:42:25] ERROR: Unable to start resource resourcebrowser;[2011-05-29 18:42:25] ERROR: Unable to start resource resourcemanager;
[2011-05-29 18:42:25] ERROR: Unable to start resource webadmin;
[2011-05-29 18:42:25] ERROR: Couldn’t find resource race_playerstatsgui. Check it exists.
[2011-05-29 18:42:25] ERROR: Couldn’t find resource race_playerstats. Check it exists.
[2011-05-29 18:42:25] ERROR: Unable to start resource race;
[2011-05-29 18:42:25] Server started and is ready to accept connections!
[2011-05-29 18:42:25] Type ‘help’ for a list of commands. -
- #4
Als erstes würde ich mal versuchen die Meta.xml von den beiden ersten nicht geladenen Resourcen einzufügen:
[2011-05-29 18:42:23] ERROR: Couldn't find meta.xml file for resource 'Server Maps' [2011-05-29 18:42:24] ERROR: Couldn't find meta.xml file for resource 'br-sf'
-
-
- #6
Sind denn wenigstens in den anderen Resourcen die meta.xml ‘s drinne?
-
- #7
Hab es hinbekommen
http://community.mtasa.com/ind…on=1.0.0&selectincludes=1 Angeschaut.
Resources überprüft.
Es fehlte die killmassage die ich vorher gelöscht habe xD Danke ann Tockra nochmal.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Closed
Samurai016 opened this issue
Sep 4, 2019
· 3 comments
Comments
Issue
When OpenFile.open(filePath);
is fired, this exception is thrown:
E/MethodChannel#open_file( 3078): Failed to handle method call
E/MethodChannel#open_file( 3078): java.lang.IllegalArgumentException: Couldn't find meta-data for provider with authority com.example.musiker.fileProvider
E/MethodChannel#open_file( 3078): at androidx.core.content.FileProvider.parsePathStrategy(FileProvider.java:606)
E/MethodChannel#open_file( 3078): at androidx.core.content.FileProvider.getPathStrategy(FileProvider.java:579)
E/MethodChannel#open_file( 3078): at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:417)
E/MethodChannel#open_file( 3078): at com.crazecoder.openfile.OpenFilePlugin.startActivity(OpenFilePlugin.java:130)
E/MethodChannel#open_file( 3078): at com.crazecoder.openfile.OpenFilePlugin.onMethodCall(OpenFilePlugin.java:88)
E/MethodChannel#open_file( 3078): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:222)
E/MethodChannel#open_file( 3078): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96)
E/MethodChannel#open_file( 3078): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:643)
E/MethodChannel#open_file( 3078): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#open_file( 3078): at android.os.MessageQueue.next(MessageQueue.java:326)
E/MethodChannel#open_file( 3078): at android.os.Looper.loop(Looper.java:160)
E/MethodChannel#open_file( 3078): at android.app.ActivityThread.main(ActivityThread.java:6694)
E/MethodChannel#open_file( 3078): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#open_file( 3078): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/MethodChannel#open_file( 3078): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
E/flutter ( 3078): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(error, Couldn't find meta-data for provider with authority com.example.musiker.fileProvider, null)
Example code
Setup
Device: Xiaomi Mi A2 Lite
Android version: 9
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.my.app"> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.INTERNET" /> <application android:name="io.flutter.app.FlutterApplication" android:label="musiker" android:icon="@mipmap/ic_launcher"> <activity> ... </activity> <provider android:name="androidx.core.content.FileProvider" android:authorities="${applicationId}.fileProvider" android:exported="false" android:grantUriPermissions="true" tools:replace="android:authorities"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/filepaths" tools:replace="android:resource" /> </provider> <provider android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider" android:authorities="${applicationId}.flutter_downloader.provider" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths"/> </provider> </application> </manifest>
Dependencies
... dio: ^2.1.16 flutter_downloader: ^1.2.1 path_provider: ^1.2.0 path: ^1.6.2 open_file: ^2.0.3 ...
tools:replace="android:authorities"
add it in
tools:replace="android:authorities"
add it in
I already added it, as you can see in my provider:
<provider android:name="androidx.core.content.FileProvider" android:authorities="${applicationId}.fileProvider" android:exported="false" android:grantUriPermissions="true" tools:replace="android:authorities">
Sorry, I did not see multiple providers here, I think you can delete the one without tools:replace and try it
2 participants