TrustKit-Android
TrustKit-Android copied to clipboard
Caused by: com.datatheorem.android.trustkit.config.ConfigurationException: Tried to pin an invalid domain: <mydomain.com>
Hi I'm getting below error while running my application.
2021-06-09 16:46:02.179 13796-13796/packagename E/AndroidRuntime: FATAL EXCEPTION: main Process: packagename, PID: 13796 java.lang.RuntimeException: Unable to create application packagename.Application: com.datatheorem.android.trustkit.config.ConfigurationException: Tried to pin an invalid domain: <mydomain.com> at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6465) at android.app.ActivityThread.access$1300(ActivityThread.java:219) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1859) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) Caused by: com.datatheorem.android.trustkit.config.ConfigurationException: Tried to pin an invalid domain: <mydomain.com>
Android studio - 4.2.1 Android Gradle plugin verions - 4.2.1 Gradle version - 6.7.1 trustkit version - com.datatheorem.android.trustkit:trustkit:1.1.2
Could you please help me anybody ?
Hello @mallikarjunch09 you should show your network_security_config.xml to have help.
Hi @ben-j69 please check network_security_config.xml file Please help me i'm struck with this since many days
<!--Added for cleartexttraffice error in android 9 and above-->
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
<!-- Official Android N API -->
<domain-config enforcePinning="true">
<domain includeSubdomains="true">domain name goes here
</domain>
<!-- Valid pins -->
<pin-set>
<pin digest="SHA-256">KEY goes here</pin>
<pin digest="SHA-256">KEY goes here</pin>
</pin-set>
<trustkit-config
disableDefaultReportUri="true"
enforcePinning="true">
<!-- Add a reporting URL for pin validation reports -->
<report-uri>https://overmind.datatheorem.com/trustkit/report</report-uri>
</trustkit-config>
</domain-config>
<domain-config enforcePinning="true">
<domain includeSubdomains="true">domain name goes here</domain>
<pin-set expiration="2021-03-14">
<pin digest="SHA-256">KEY goes here</pin>
<!-- backup pin-->
<pin digest="SHA-256">KEY goes here</pin>
<pin digest="SHA-256">KEY goes here</pin>
<!-- backup pin-->
<pin digest="SHA-256">KEY goes here</pin>
</pin-set>
<trustkit-config
disableDefaultReportUri="true"
enforcePinning="true">
<!-- Add a reporting URL for pin validation reports -->
<report-uri>https://overmind.datatheorem.com/trustkit/report</report-uri>
</trustkit-config>
</domain-config>
@mallikarjunch09 if you read your error and your file this si crystal clear, you have invalid domain names like "domain name goes here". Just fix your config file.