简体   繁体   English

React Native Expo - Google Play Console 告诉我我要求我不要求的权限

[英]React native Expo - Google Play Console tells me i ask for permissions i don't

I'm trying to publish my React native application app to the Google Play Store, but when adding my .apk as first version, it tells me I'm asking for permissions requiring confidentiality rules, even though I never ask for those, and when installing the .apk directly on my phone, it nevers asks for any permission.我正在尝试将我的 React Native 应用程序发布到 Google Play 商店,但是当将我的 .apk 添加为第一个版本时,它告诉我我正在请求需要保密规则的权限,即使我从未要求过这些,以及何时直接在我的手机上安装 .apk,它从不要求任何许可。

在此处输入图片说明

The error.错误。

For non-french-speaking fellows, it's telling me the importation has failed because my apk uses permissions that require conficentiality rules (android.permissions.CAMERA, android.permissions.RECORD_AUDIO ...)对于不会说法语的家伙,它告诉我导入失败,因为我的 apk 使用需要保密规则的权限(android.permissions.CAMERA、android.permissions.RECORD_AUDIO ...)

// Copyright 2015-present Facebook. All Rights Reserved.

apply plugin: 'com.android.library'
apply plugin: 'maven'

apply plugin: 'de.undercouch.download'

import de.undercouch.gradle.tasks.download.Download
import org.apache.tools.ant.taskdefs.condition.Os
import org.apache.tools.ant.filters.ReplaceTokens

// We download various C++ open-source dependencies into downloads.
// We then copy both the downloaded code and our custom makefiles and headers into third-party-ndk.
// After that we build native code from src/main/jni with module path pointing at third-party-ndk.

def downloadsDir = new File("$buildDir/downloads")
def thirdPartyNdkDir = new File("$buildDir/third-party-ndk")

// You need to have following folders in this directory:
//   - boost_1_63_0
//   - double-conversion-1.1.1
//   - folly-deprecate-dynamic-initializer
//   - glog-0.3.3
//   - jsc-headers
def dependenciesPath = System.getenv("REACT_NATIVE_DEPENDENCIES")

// The Boost library is a very large download (>100MB).
// If Boost is already present on your system, define the REACT_NATIVE_BOOST_PATH env variable
// and the build will use that.
def boostPath = dependenciesPath ?: System.getenv("REACT_NATIVE_BOOST_PATH")

task createNativeDepsDirectories {
    downloadsDir.mkdirs()
    thirdPartyNdkDir.mkdirs()
}

task downloadBoost(dependsOn: createNativeDepsDirectories, type: Download) {
    src 'https://github.com/react-native-community/boost-for-react-native/releases/download/v1.63.0-0/boost_1_63_0.tar.gz'
    onlyIfNewer true
    overwrite false
    dest new File(downloadsDir, 'boost_1_63_0.tar.gz')
}

task prepareBoost(dependsOn: boostPath ? [] : [downloadBoost], type: Copy) {
    from boostPath ?: tarTree(resources.gzip(downloadBoost.dest))
    from 'src/main/jni/third-party/boost/Android.mk'
    include 'Android.mk', 'boost_1_63_0/boost/**/*.hpp', 'boost/boost/**/*.hpp'
    includeEmptyDirs = false
    into "$thirdPartyNdkDir/boost"
    doLast {
        file("$thirdPartyNdkDir/boost/boost").renameTo("$thirdPartyNdkDir/boost/boost_1_63_0")
    }
}

task downloadDoubleConversion(dependsOn: createNativeDepsDirectories, type: Download) {
    src 'https://github.com/google/double-conversion/archive/v1.1.1.tar.gz'
    onlyIfNewer true
    overwrite false
    dest new File(downloadsDir, 'double-conversion-1.1.1.tar.gz')
}

task prepareDoubleConversion(dependsOn: dependenciesPath ? [] : [downloadDoubleConversion], type: Copy) {
    from dependenciesPath ?: tarTree(downloadDoubleConversion.dest)
    from 'src/main/jni/third-party/double-conversion/Android.mk'
    include 'double-conversion-1.1.1/src/**/*', 'Android.mk'
    filesMatching('*/src/**/*', {fname -> fname.path = "double-conversion/${fname.name}"})
    includeEmptyDirs = false
    into "$thirdPartyNdkDir/double-conversion"
}

task downloadFolly(dependsOn: createNativeDepsDirectories, type: Download) {
    src 'https://github.com/facebook/folly/archive/v2016.09.26.00.tar.gz'
    onlyIfNewer true
    overwrite false
    dest new File(downloadsDir, 'folly-2016.09.26.00.tar.gz');
}

task prepareFolly(dependsOn: dependenciesPath ? [] : [downloadFolly], type: Copy) {
    from dependenciesPath ?: tarTree(downloadFolly.dest)
    from 'src/main/jni/third-party/folly/Android.mk'
    include 'folly-2016.09.26.00/folly/**/*', 'Android.mk'
    eachFile {fname -> fname.path = (fname.path - "folly-2016.09.26.00/")}
    includeEmptyDirs = false
    into "$thirdPartyNdkDir/folly"
}

task downloadGlog(dependsOn: createNativeDepsDirectories, type: Download) {
    src 'https://github.com/google/glog/archive/v0.3.3.tar.gz'
    onlyIfNewer true
    overwrite false
    dest new File(downloadsDir, 'glog-0.3.3.tar.gz')
}

// Prepare glog sources to be compiled, this task will perform steps that normally should've been
// executed by automake. This way we can avoid dependencies on make/automake
task prepareGlog(dependsOn: dependenciesPath ? [] : [downloadGlog], type: Copy) {
    from dependenciesPath ?: tarTree(downloadGlog.dest)
    from 'src/main/jni/third-party/glog/'
    include 'glog-0.3.3/src/**/*', 'Android.mk', 'config.h'
    includeEmptyDirs = false
    filesMatching('**/*.h.in') {
        filter(ReplaceTokens, tokens: [
                ac_cv_have_unistd_h: '1',
                ac_cv_have_stdint_h: '1',
                ac_cv_have_systypes_h: '1',
                ac_cv_have_inttypes_h: '1',
                ac_cv_have_libgflags: '0',
                ac_google_start_namespace: 'namespace google {',
                ac_cv_have_uint16_t: '1',
                ac_cv_have_u_int16_t: '1',
                ac_cv_have___uint16: '0',
                ac_google_end_namespace: '}',
                ac_cv_have___builtin_expect: '1',
                ac_google_namespace: 'google',
                ac_cv___attribute___noinline: '__attribute__ ((noinline))',
                ac_cv___attribute___noreturn: '__attribute__ ((noreturn))',
                ac_cv___attribute___printf_4_5: '__attribute__((__format__ (__printf__, 4, 5)))'
        ])
        it.path = (it.name - '.in')
    }
    into "$thirdPartyNdkDir/glog"
}

task downloadJSCHeaders(type: Download) {
    // in sync with webkit SVN revision 174650
    def jscAPIBaseURL = 'https://raw.githubusercontent.com/WebKit/webkit/38b15a3ba3c1b0798f2036f7cea36ffdc096202e/Source/JavaScriptCore/API/'
    def jscHeaderFiles = ['JavaScript.h', 'JSBase.h', 'JSContextRef.h', 'JSObjectRef.h', 'JSRetainPtr.h', 'JSStringRef.h', 'JSValueRef.h', 'WebKitAvailability.h']
    def output = new File(downloadsDir, 'jsc')
    output.mkdirs()
    src(jscHeaderFiles.collect { headerName -> "$jscAPIBaseURL$headerName" })
    onlyIfNewer true
    overwrite false
    dest output
}

// Create Android.mk library module based on so files from mvn + include headers fetched from webkit.org
task prepareJSC(dependsOn: dependenciesPath ? [] : [downloadJSCHeaders]) << {
    copy {
        from zipTree(configurations.compile.fileCollection { dep -> dep.name == 'android-jsc' }.singleFile)
        from dependenciesPath ? "$dependenciesPath/jsc-headers" : {downloadJSCHeaders.dest}
        from 'src/main/jni/third-party/jsc/Android.mk'
        include 'jni/**/*.so', '*.h', 'Android.mk'
        filesMatching('*.h', { fname -> fname.path = "JavaScriptCore/${fname.path}"})
        into "$thirdPartyNdkDir/jsc";
    }
}

def getNdkBuildName() {
    if (Os.isFamily(Os.FAMILY_WINDOWS)) {
        return "ndk-build.cmd"
    } else {
        return "ndk-build"
    }
}

def findNdkBuildFullPath() {
    // we allow to provide full path to ndk-build tool
    if (hasProperty('ndk.command')) {
        return property('ndk.command')
    }
    // or just a path to the containing directory
    if (hasProperty('ndk.path')) {
        def ndkDir = property('ndk.path')
        return new File(ndkDir, getNdkBuildName()).getAbsolutePath()
    }
    if (System.getenv('ANDROID_NDK') != null) {
        def ndkDir = System.getenv('ANDROID_NDK')
        return new File(ndkDir, getNdkBuildName()).getAbsolutePath()
    }
    def ndkDir = android.hasProperty('plugin') ? android.plugin.ndkFolder :
            plugins.getPlugin('com.android.library').hasProperty('sdkHandler') ?
                    plugins.getPlugin('com.android.library').sdkHandler.getNdkFolder() :
                    android.ndkDirectory.absolutePath
    if (ndkDir) {
        return new File(ndkDir, getNdkBuildName()).getAbsolutePath()
    }
    return null
}

def getNdkBuildFullPath() {
    def ndkBuildFullPath = findNdkBuildFullPath()
    if (ndkBuildFullPath == null) {
        throw new GradleScriptException(
            "ndk-build binary cannot be found, check if you've set " +
            "\$ANDROID_NDK environment variable correctly or if ndk.dir is " +
            "setup in local.properties",
            null)
    }
    if (!new File(ndkBuildFullPath).canExecute()) {
        throw new GradleScriptException(
            "ndk-build binary " + ndkBuildFullPath + " doesn't exist or isn't executable.\n" +
            "Check that the \$ANDROID_NDK environment variable, or ndk.dir in local.properties, is set correctly.\n" +
            "(On Windows, make sure you escape backslashes in local.properties or use forward slashes, e.g. C:\\\\ndk or C:/ndk rather than C:\\ndk)",
            null)
    }
    return ndkBuildFullPath
}

task buildReactNdkLib(dependsOn: [prepareJSC, prepareBoost, prepareDoubleConversion, prepareFolly, prepareGlog], type: Exec) {
    inputs.file('src/main/jni/react')
    outputs.dir("$buildDir/react-ndk/all")
    commandLine getNdkBuildFullPath(),
            'NDK_PROJECT_PATH=null',
            "NDK_APPLICATION_MK=$projectDir/src/main/jni/Application.mk",
            'NDK_OUT=' + temporaryDir,
            "NDK_LIBS_OUT=$buildDir/react-ndk/all",
            "THIRD_PARTY_NDK_DIR=$buildDir/third-party-ndk",
            "REACT_COMMON_DIR=$projectDir/../ReactCommon",
            '-C', file('src/main/jni/react/jni').absolutePath,
            '--jobs', project.hasProperty("jobs") ? project.property("jobs") : Runtime.runtime.availableProcessors()
}

task cleanReactNdkLib(type: Exec) {
    commandLine getNdkBuildFullPath(),
            "NDK_APPLICATION_MK=$projectDir/src/main/jni/Application.mk",
            "THIRD_PARTY_NDK_DIR=$buildDir/third-party-ndk",
            "REACT_COMMON_DIR=$projectDir/../ReactCommon",
            '-C', file('src/main/jni/react/jni').absolutePath,
            'clean'
}

task packageReactNdkLibs(dependsOn: buildReactNdkLib, type: Copy) {
    from "$buildDir/react-ndk/all"
    exclude '**/libjsc.so'
    into "$buildDir/react-ndk/exported"
}

task packageReactNdkLibsForBuck(dependsOn: packageReactNdkLibs, type: Copy) {
    from "$buildDir/react-ndk/exported"
    into "src/main/jni/prebuilt/lib"
}

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"

        ndk {
            moduleName "reactnativejni"
        }

        buildConfigField 'boolean', 'IS_INTERNAL_BUILD', 'false'
        buildConfigField 'int', 'EXOPACKAGE_FLAGS', '0'
        testApplicationId "com.facebook.react.tests.gradle"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    sourceSets.main {
        jni.srcDirs = []
        jniLibs.srcDir "$buildDir/react-ndk/exported"
        res.srcDirs = ['src/main/res/devsupport', 'src/main/res/shell', 'src/main/res/views/modal', 'src/main/res/views/uimanager']
        java {
            srcDirs = ['src/main/java', 'src/main/libraries/soloader/java', 'src/main/jni/first-party/fb/jni/java']
            exclude 'com/facebook/react/processing'
            exclude 'com/facebook/react/module/processing'
        }
    }

    tasks.withType(JavaCompile) {
        compileTask -> compileTask.dependsOn packageReactNdkLibs
    }

    clean.dependsOn cleanReactNdkLib

    lintOptions {
        abortOnError false
    }
    packagingOptions {
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
    }
}

dependencies {
    compile fileTree(dir: 'src/main/third-party/java/infer-annotations/', include: ['*.jar'])
    compile 'javax.inject:javax.inject:1'
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.facebook.fbui.textlayoutbuilder:textlayoutbuilder:1.0.0'
    compile 'com.facebook.fresco:fresco:1.0.1'
    compile 'com.facebook.fresco:imagepipeline-okhttp3:1.0.1'
    compile 'com.facebook.soloader:soloader:0.1.0'
    compile 'com.google.code.findbugs:jsr305:3.0.0'
    compile 'com.squareup.okhttp3:okhttp:3.6.0'
    compile 'com.squareup.okhttp3:okhttp-urlconnection:3.6.0'
    compile 'com.squareup.okio:okio:1.13.0'
    compile 'org.webkit:android-jsc:r174650'

    testCompile "junit:junit:${JUNIT_VERSION}"
    testCompile "org.powermock:powermock-api-mockito:${POWERMOCK_VERSION}"
    testCompile "org.powermock:powermock-module-junit4-rule:${POWERMOCK_VERSION}"
    testCompile "org.powermock:powermock-classloading-xstream:${POWERMOCK_VERSION}"
    testCompile "org.mockito:mockito-core:${MOCKITO_CORE_VERSION}"
    testCompile "org.easytesting:fest-assert-core:${FEST_ASSERT_CORE_VERSION}"
    testCompile "org.robolectric:robolectric:${ROBOLECTRIC_VERSION}"

    androidTestCompile fileTree(dir: 'src/main/third-party/java/buck-android-support/', include: ['*.jar'])
    androidTestCompile 'com.android.support.test:runner:0.3'
    androidTestCompile "org.mockito:mockito-core:${MOCKITO_CORE_VERSION}"
}

apply from: 'release.gradle'

My question has been answered on the Expo Forum.我的问题已经在世博论坛上得到了解答。

In your app.json :在你的 app.json 中:

...
"android": {
    ...,
    "permissions": []
},
...

Just spent 3 damn hours on this crap.刚刚在这个废话上花了 3 个该死的小时。

If they ask you for permissions make sure you have the correct permissions in your如果他们要求您授予权限,请确保您在

src/app/main/AndroidManifest.xml

for a full list of permission check React-native Android permission有关完整的权限列表,请检查React-native Android 权限

    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.MANAGE_DOCUMENTS" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

after you have done that (this is the part that took me 3 hours) :完成后(这是我花了 3 个小时的部分):

  1. go to your google play store去你的谷歌游戏商店
  2. scroll down to the bottom向下滚动到底部
  3. look at the left side for a like app content , click on that查看左侧的类似app content ,单击该app content
  4. fill in your Privacy policy info (they want a link for that)填写您的Privacy policy信息(他们想要一个链接)
  5. Upload your app again再次上传您的应用
  6. ENJOY!!!!享受!!!!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Google Play 控制台上传我的 React Native/Expo 应用程序时出错 - Error at uploading my React Native/Expo app on Google Play Console Android 权限问我不想要的东西 - Android permissions ask something I don't want 我应该在运行时询问哪些权限,而在 Android 中我不必询问运行时? - Which permissions should I ask at runtime and which I don't have to ask runtime in Android? 我无法在 Google Play 控制台上重置敏感应用权限声明 - I can't reset sensitive app permissions declaration on Google Play console Google Play 控制台未在来自 React Native expo 的捆绑包中正确检测到我的 SDK 版本 - Google play console not detecting my SDK version correctly in bundles from react native expo Google Play 商店没有要求我创建上传密钥库.....我还需要创建一个吗? - Google Play Store did not ask me to create an upload keystore.....do I still have to create one? Google Play 管理中心要求我在发布应用之前对其进行审核,但我无需采取任何其他步骤 - Google Play Console demands I review my app before I release it, but there aren't any additional steps for me to take 如何将 react-native-google-mobile-ads 与 Expo 和 Expo Go 一起使用? - How do I use react-native-google-mobile-ads with Expo and Expo Go? iOS中的模块react-native-image-picker总是需要麦克风权限,尽管我不选择视频,只选择摄像头 - The module react-native-image-picker in iOS always requires microphone permissions although I don't select video, only camera 将 React Native 应用程序上传到 Google 控制台 [Expo Ejected] - Upload React Native app to Google Console [Expo Ejected]
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM