NativeScript / nativescript-camera

NativeScript plugin to empower using device camera.
Apache License 2.0
92 stars 47 forks source link

nativescript-mediafilepicker conflicts with nativescript-camera #164

Closed tsonevn closed 5 years ago

tsonevn commented 5 years ago

@jokro commented on Tue Jan 22 2019

After installing nativescript-mediafilepicker my app doesn't built (tns error 0) and shows an error stating there is a conflict in the manifest files of camera and  nativescript-mediafilepicker. I cannot find these plugin manifest files. The error:

C:\Users\Jokro\Software\NativeScript\mappi\platforms\android\app\src\main\AndroidManifest.xml:19:17-55 Error:

    Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/provider_paths) from [:nativescript_camera:] AndroidManifest.xml:19:17-55
    is also present at [:MultiTypeFilePicker-release:] AndroidManifest.xml:46:17-51 value=(@xml/file_paths).
    Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml to override.

FAILURE: Build failed with an exception. I ran tns plugin add nativescript-mediafilepicker, removed and reinstalled android and ran in VS, Then the following error turned up: C:\Users\Jokro\Software\NativeScript\mappi\platforms\android\app\src\main\AndroidManifest.xml:19:17-55 Error:

Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/provider_paths) from [:nativescript_camera:] AndroidManifest.xml:19:17-55
is also present at [:MultiTypeFilePicker-release:] AndroidManifest.xml:46:17-51 value=(@xml/file_paths).
Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml to override.

FAILURE: Build failed with an exception.

My manifest contains 43 lines of code:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="__PACKAGE__"
    android:versionCode="1"
    android:versionName="1.0">

    <supports-screens
        android:smallScreens="true"
        android:normalScreens="true"
        android:largeScreens="true"
        android:xlargeScreens="true"/>

    <uses-sdk
        android:minSdkVersion="17"
        android:targetSdkVersion="__APILEVEL__"/>

    <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="com.tns.NativeScriptApplication"
        android:allowBackup="true"
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">

        <activity
            android:name="com.tns.NativeScriptActivity"
            android:label="@string/title_activity_kimera"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:theme="@style/LaunchScreenTheme">

            <meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="com.tns.ErrorReportActivity"/>
    </application>
</manifest>

Rule 19 contains:

I replaced this and the previous two lines by:

**`

`**

The error still exists.

In directory nodemodules/nativescript-mediafilepicker i looked for a second AndroidManifest.xml, but can't find any.

pakage.json of camera contains:

"_from": "nativescript-camera", "_id": "nativescript-camera@4.1.1", "_inBundle": false, "_integrity": "sha512-yqUUiW5/18LahuMr0RwZkfRBYNCsrRsxiV4/xGSWrNXa7HFD5a6olLiQj/mzGVjX+dyOyQhWPXJ0ZfZ4JDve4A==", "_location": "/nativescript-camera", "_phantomChildren": {}, "_requested": { "type": "tag", "registry": true, "raw": "nativescript-camera", "name": "nativescript-camera", "escapedName": "nativescript-camera", "rawSpec": "", "saveSpec": null, "fetchSpec": "latest" }, "_requiredBy": [ "#USER", "/" ], "_resolved": "https://registry.npmjs.org/nativescript-camera/-/nativescript-camera-4.1.1.tgz", "_shasum": "b68135327280654bd05d041eb08152b36be23f82", "_spec": "nativescript-camera", "_where": "C:\Users\Jokro\Software\NativeScript\mappi", "author": { "name": "NativeScript team" }, "bugs": { "url": "https://github.com/NativeScript/nativescript-camera/issues" }, "bundleDependencies": false, "dependencies": { "nativescript-permissions": "^1.2.3" }, "deprecated": false, "description": "Provides API for using device camera", "devDependencies": { "prompt": "^1.0.0", "rimraf": "^2.6.2", "tns-core-modules": "^5.0.1", "tns-platform-declarations": "^5.0.0", "tslint": "~5.11.0", "typescript": "~2.8.2" }, "homepage": "https://github.com/NativeScript/nativescript-camera#readme", "keywords": [ "NativeScript", "JavaScript", "Android", "iOS", "camera", "gallery", "images" ], "license": "Apache-2.0", "main": "camera", "name": "nativescript-camera", "nativescript": { "platforms": { "android": "3.0.0", "ios": "3.0.0"

    }
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/NativeScript/nativescript-camera.git"
  },
  "scripts": {
    "build": "npm i && tsc",
    "ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**'",
    "clean": "cd ../demo && rimraf hooks node_modules platforms && cd ../src && rimraf node_modules && npm run plugin.link",
    "demo.android": "npm i && npm run tsc && cd ../demo && tns run android --syncAllFiles",
    "demo.ios": "npm i && npm run tsc && cd ../demo && tns run ios --syncAllFiles",
    "demo.ng.android": "npm i && npm run tsc && cd ../demo-angular && tns run android --syncAllFiles",
    "demo.ng.ios": "npm i && npm run tsc && cd ../demo-angular && tns run ios --syncAllFiles",
    "demo.reset": "cd ../demo && rimraf platforms",
    "plugin.link": "npm link && cd ../demo && npm link nativescript-camera",
    "plugin.prepare": "npm run tsc && cd ../demo && tns plugin remove nativescript-camera && tns plugin add ../src",
    "plugin.tscwatch": "npm run tsc -- -w",
    "postclone": "npm i && node scripts/postclone.js && cd ../demo && npm i && cd ../src && npm run plugin.link",
    "test.android": "npm i && npm run tsc && npm run tslint && cd ../demo && tns build android && tns test android --justlaunch",
    "test.ios": "npm i && npm run tsc && npm run tslint && cd ../demo && tns build ios && tns test ios --justlaunch",
    "tsc": "tsc -skipLibCheck",
    "tslint": "cd .. && tslint \"**/*.ts\" --config tslint.json --exclude \"**/node_modules/**\""
  },
  "typings": "index.d.ts",
  "version": "4.1.1"
}

mediafilepicker has json file with:


{
  "_from": "nativescript-mediafilepicker",
  "_id": "nativescript-mediafilepicker@2.0.16",
  "_inBundle": false,
  "_integrity": "sha512-4gCvCWUwJ66fFT7IHITHftTZ5betwPBDWZOcRjDWpuIyPqroYBpaKszXXuYpb03VGZ7DbIHDBKUX4MKvJ8lzCw==",
  "_location": "/nativescript-mediafilepicker",
  "_phantomChildren": {},
  "_requested": {
    "type": "tag",
    "registry": true,
    "raw": "nativescript-mediafilepicker",
    "name": "nativescript-mediafilepicker",
    "escapedName": "nativescript-mediafilepicker",
    "rawSpec": "",
    "saveSpec": null,
    "fetchSpec": "latest"
  },
  "_requiredBy": [
    "#USER",
    "/"
  ],
  "_resolved": "https://registry.npmjs.org/nativescript-mediafilepicker/-/nativescript-mediafilepicker-2.0.16.tgz",
  "_shasum": "04f07af01654ec1c68695d8655a83c11c619fd9a",
  "_spec": "nativescript-mediafilepicker",
  "_where": "C:\\Users\\Jokro\\Software\\NativeScript\\mappi",
  "author": {
    "name": "Jibon L. Costa",
    "email": "jiboncosta57@gmail.com"
  },
  "bootstrapper": "nativescript-plugin-seed",
  "bugs": {
    "url": "https://github.com/jibon57/nativescript-mediafilepicker/issues"
  },
  "bundleDependencies": false,
  "dependencies": {
    "nativescript-permissions": "^1.2.3"
  },
  "deprecated": false,
  "description": "NativeScript mediafilepicker plugin.",
  "devDependencies": {
    "prompt": "^1.0.0",
    "rimraf": "^2.6.2",
    "semver": "^5.5.0",
    "tns-core-modules": "^5.0.5",
    "tns-platform-declarations": "^5.0.5",
    "tslint": "^5.11.0",
    "typescript": "~2.8.2"
  },
  "homepage": "https://github.com/jibon57/nativescript-mediafilepicker",
  "keywords": [
    "NativeScript",
    "JavaScript",
    "Android",
    "iOS"
  ],
  "license": "Apache-2.0",
  "main": "mediafilepicker",
  "name": "nativescript-mediafilepicker",
  "nativescript": {
    "platforms": {
      "android": "4.2.0",
      "ios": "4.2.0"
    }
  },
  "scripts": {
    "build": "npm run tsc && npm run build.native",
    "build.native": "node scripts/build-native.js",
    "ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json'",
    "clean": "npm run demo.reset && npx rimraf -- node_modules package-lock.json && npm i",
    "demo.android": "npm run tsc && cd ../demo && tns run android --syncAllFiles",
    "demo.ios": "npm run tsc && cd ../demo && tns run ios --syncAllFiles --emulator",
    "demo.reset": "cd ../demo && npx rimraf -- hooks node_modules platforms package-lock.json",
    "plugin.prepare": "npm run build && cd ../demo && tns plugin remove nativescript-mediafilepicker && tns plugin add ../src",
    "plugin.tscwatch": "npm run tsc -- -w",
    "postclone": "npm i && node scripts/postclone.js && cd ../demo && npm i && npx rimraf -- package-lock.json && cd ../src",
    "prepack": "npm run build.native",
    "test.android": "npm i && npm run tsc && npm run tslint && cd ../demo && tns build android && tns test android --justlaunch",
    "test.ios": "npm i && npm run tsc && npm run tslint && cd ../demo && tns build ios && tns test ios --justlaunch",
    "tsc": "tsc",
    "tslint": "cd .. && tslint \"**/*.ts\" --config tslint.json"
  },
  "typings": "index.d.ts",
  "version": "2.0.16"
}

What can be the problem ? If I deinstall mediafilepicker all works ok.