小编Tan*_*ury的帖子

添加了 android:exported 但仍然出现错误面向 Android 12 及更高版本的应用程序需要为 android:exported 指定显式值

我已添加android:exported="true"到清单中唯一的活动,但在将编译 sdk 和目标 sdk 版本更新为 31 后仍然出现以下错误。我还尝试重建项目、使缓存无效并重新启动,但这没有帮助

错误- Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

AndroidManifest文件

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

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <application
        android:name=".framework.presentation.BaseApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name="com.xyz.presentation.MainActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
Run Code Online (Sandbox Code Playgroud)

合并清单错误

play-services-auth-api-phone:17.4.0 清单、leakcanary-android:2.0-alpha-3 清单、firebase-auth-interop:20.0.0 清单、生命周期-viewmodel:2.3.1 清单、浏览器:1.0。 0 …

android manifest android-manifest targetsdkversion android-12

47
推荐指数
6
解决办法
8万
查看次数

我如何为单个应用程序使用多个数据源来分离公司明智的数据

假设我的实体模型现在如下

@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
@Builder(builderClassName = "Builder", toBuilder = true)
@Entity
@Table(name = "clients")
public class Client extends Person {
    @Column(name = "initials")
    private String initials;

    @Column(name = "prefix")
    private String prefix;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "company_Id")
    private Company company;
}
Run Code Online (Sandbox Code Playgroud)

所有记录当前都存储在具有单个数据源的同一个表中。但我想改变这一点。我希望每个公司都有相同的数据库,并且公司特定的数据将插入到以下公司数据库中。但服务和存储库方法将是相同的。我想以不需要更改我的服务和存储库方法的方式实现这一点。

我从这个链接中得到了一些想法。 https://blogs.sap.com/2016/12/19/developing-multi-tenant-applications-on-hcp-persistence-multitenancy-part-4/。但我想要一些关于实施的更复杂的指南。

java eclipselink spring-data

5
推荐指数
1
解决办法
208
查看次数